+
Share the video
diff --git a/client/src/app/+videos/+video-watch/modal/video-share.component.scss b/client/src/app/shared/shared-share-modal/video-share.component.scss
similarity index 100%
rename from client/src/app/+videos/+video-watch/modal/video-share.component.scss
rename to client/src/app/shared/shared-share-modal/video-share.component.scss
diff --git a/client/src/app/+videos/+video-watch/modal/video-share.component.ts b/client/src/app/shared/shared-share-modal/video-share.component.ts
similarity index 93%
rename from client/src/app/+videos/+video-watch/modal/video-share.component.ts
rename to client/src/app/shared/shared-share-modal/video-share.component.ts
index d9171fe0e..8d8e8a3a5 100644
--- a/client/src/app/+videos/+video-watch/modal/video-share.component.ts
+++ b/client/src/app/shared/shared-share-modal/video-share.component.ts
@@ -1,9 +1,9 @@
import { Component, ElementRef, Input, ViewChild } from '@angular/core'
-import { buildVideoOrPlaylistEmbed, buildVideoLink, buildPlaylistLink } from '../../../../assets/player/utils'
-import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
-import { VideoCaption } from '@shared/models'
import { VideoDetails } from '@app/shared/shared-main'
import { VideoPlaylist } from '@app/shared/shared-video-playlist'
+import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
+import { VideoCaption } from '@shared/models'
+import { buildPlaylistLink, buildVideoLink, buildVideoOrPlaylistEmbed } from '../../../assets/player/utils'
type Customizations = {
startAtCheckbox: boolean
@@ -51,7 +51,7 @@ export class VideoShareComponent {
show (currentVideoTimestamp?: number, currentPlaylistPosition?: number) {
let subtitle: string
- if (this.videoCaptions.length !== 0) {
+ if (this.videoCaptions && this.videoCaptions.length !== 0) {
subtitle = this.videoCaptions[0].language.id
}
@@ -60,7 +60,7 @@ export class VideoShareComponent {
startAt: currentVideoTimestamp ? Math.floor(currentVideoTimestamp) : 0,
stopAtCheckbox: false,
- stopAt: this.video.duration,
+ stopAt: this.video?.duration,
subtitleCheckbox: false,
subtitle,
@@ -118,10 +118,6 @@ export class VideoShareComponent {
return this.activeVideoId === 'embed'
}
- hasPlaylist () {
- return !!this.playlist
- }
-
private getPlaylistOptions (baseUrl?: string) {
return {
baseUrl,
diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss
index cdf0ee992..f4e4d8977 100644
--- a/client/src/sass/application.scss
+++ b/client/src/sass/application.scss
@@ -282,6 +282,7 @@ table {
max-height: 500px;
display: flex;
+ flex-direction: column;
align-items: center;
justify-content: center;
font-size: 16px;