From 6863f814b06e4af92fd19bef23e6bd4b259988fa Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 3 Aug 2020 21:06:45 +0200 Subject: special display case for logged-out users to display download in watch page --- client/src/app/+videos/+video-watch/video-watch.component.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'client/src/app/+videos/+video-watch/video-watch.component.ts') diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts index 4341514cd..e355faf25 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts @@ -28,6 +28,7 @@ import { environment } from '../../../environments/environment' import { VideoShareComponent } from './modal/video-share.component' import { VideoSupportComponent } from './modal/video-support.component' import { VideoWatchPlaylistComponent } from './video-watch-playlist.component' +import { VideoDownloadComponent } from '@app/shared/shared-video-miniature' @Component({ selector: 'my-video-watch', @@ -41,6 +42,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { @ViewChild('videoShareModal') videoShareModal: VideoShareComponent @ViewChild('videoSupportModal') videoSupportModal: VideoSupportComponent @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent + @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent player: any playerElement: HTMLVideoElement @@ -201,6 +203,14 @@ export class VideoWatchComponent implements OnInit, OnDestroy { this.completeDescriptionShown = false } + showDownloadModal () { + this.videoDownloadModal.show(this.video, this.videoCaptions) + } + + isVideoDownloadable () { + return this.video && this.video instanceof VideoDetails && this.video.downloadEnabled + } + loadCompleteDescription () { this.descriptionLoading = true -- cgit v1.2.3