X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-share-modal%2Fvideo-share.component.ts;fp=client%2Fsrc%2Fapp%2F%2Bvideos%2F%2Bvideo-watch%2Fmodal%2Fvideo-share.component.ts;h=8d8e8a3a59507df5ee4b1134fc9376e7ade1bb1b;hb=82f443de1aba70ce75c72a4a7f669385600ab3c6;hp=d9171fe0ecbc04ddc5d8ceff0c7f94735b1ddb45;hpb=10846ef656585ee857ec43fc22b490409ddd0d44;p=github%2FChocobozzz%2FPeerTube.git 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,