diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-08-03 21:06:45 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-08-04 16:06:40 +0200 |
commit | 6863f814b06e4af92fd19bef23e6bd4b259988fa (patch) | |
tree | e4d1dcbb5c883389435fada4cb5bcd4effae6703 /client/src | |
parent | 9a42363291c9f524d9603a940f929929599271c5 (diff) | |
download | PeerTube-6863f814b06e4af92fd19bef23e6bd4b259988fa.tar.gz PeerTube-6863f814b06e4af92fd19bef23e6bd4b259988fa.tar.zst PeerTube-6863f814b06e4af92fd19bef23e6bd4b259988fa.zip |
special display case for logged-out users to display download in watch page
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/+videos/+video-watch/video-watch.component.html | 21 | ||||
-rw-r--r-- | client/src/app/+videos/+video-watch/video-watch.component.ts | 10 |
2 files changed, 27 insertions, 4 deletions
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.html b/client/src/app/+videos/+video-watch/video-watch.component.html index fb6d08167..2588b9af5 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.html +++ b/client/src/app/+videos/+video-watch/video-watch.component.html | |||
@@ -108,10 +108,23 @@ | |||
108 | </div> | 108 | </div> |
109 | </div> | 109 | </div> |
110 | 110 | ||
111 | <my-video-actions-dropdown | 111 | <ng-container *ngIf="!isUserLoggedIn()"> |
112 | placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions" | 112 | <button |
113 | (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()" | 113 | *ngIf="isVideoDownloadable()" class="action-button action-button-save" |
114 | ></my-video-actions-dropdown> | 114 | (click)="showDownloadModal()" (keydown.enter)="showDownloadModal()" |
115 | > | ||
116 | <my-global-icon iconName="download" aria-hidden="true"></my-global-icon> | ||
117 | <span class="icon-text d-none d-sm-inline" i18n>DOWNLOAD</span> | ||
118 | </button> | ||
119 | |||
120 | <my-video-download #videoDownloadModal></my-video-download> | ||
121 | </ng-container> | ||
122 | <ng-container *ngIf="isUserLoggedIn()"> | ||
123 | <my-video-actions-dropdown | ||
124 | placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions" | ||
125 | (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()" | ||
126 | ></my-video-actions-dropdown> | ||
127 | </ng-container> | ||
115 | </div> | 128 | </div> |
116 | 129 | ||
117 | <div class="video-info-likes-dislikes-bar-outer-container"> | 130 | <div class="video-info-likes-dislikes-bar-outer-container"> |
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' | |||
28 | import { VideoShareComponent } from './modal/video-share.component' | 28 | import { VideoShareComponent } from './modal/video-share.component' |
29 | import { VideoSupportComponent } from './modal/video-support.component' | 29 | import { VideoSupportComponent } from './modal/video-support.component' |
30 | import { VideoWatchPlaylistComponent } from './video-watch-playlist.component' | 30 | import { VideoWatchPlaylistComponent } from './video-watch-playlist.component' |
31 | import { VideoDownloadComponent } from '@app/shared/shared-video-miniature' | ||
31 | 32 | ||
32 | @Component({ | 33 | @Component({ |
33 | selector: 'my-video-watch', | 34 | selector: 'my-video-watch', |
@@ -41,6 +42,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
41 | @ViewChild('videoShareModal') videoShareModal: VideoShareComponent | 42 | @ViewChild('videoShareModal') videoShareModal: VideoShareComponent |
42 | @ViewChild('videoSupportModal') videoSupportModal: VideoSupportComponent | 43 | @ViewChild('videoSupportModal') videoSupportModal: VideoSupportComponent |
43 | @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent | 44 | @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent |
45 | @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent | ||
44 | 46 | ||
45 | player: any | 47 | player: any |
46 | playerElement: HTMLVideoElement | 48 | playerElement: HTMLVideoElement |
@@ -201,6 +203,14 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
201 | this.completeDescriptionShown = false | 203 | this.completeDescriptionShown = false |
202 | } | 204 | } |
203 | 205 | ||
206 | showDownloadModal () { | ||
207 | this.videoDownloadModal.show(this.video, this.videoCaptions) | ||
208 | } | ||
209 | |||
210 | isVideoDownloadable () { | ||
211 | return this.video && this.video instanceof VideoDetails && this.video.downloadEnabled | ||
212 | } | ||
213 | |||
204 | loadCompleteDescription () { | 214 | loadCompleteDescription () { |
205 | this.descriptionLoading = true | 215 | this.descriptionLoading = true |
206 | 216 | ||