aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-miniature
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-video-miniature')
-rw-r--r--client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts4
-rw-r--r--client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html1
-rw-r--r--client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts22
3 files changed, 25 insertions, 2 deletions
diff --git a/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts b/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts
index 666144864..08c8da3dd 100644
--- a/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts
+++ b/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts
@@ -5,6 +5,7 @@ import { SharedGlobalIconModule } from '../shared-icons'
5import { SharedMainModule } from '../shared-main/shared-main.module' 5import { SharedMainModule } from '../shared-main/shared-main.module'
6import { SharedModerationModule } from '../shared-moderation' 6import { SharedModerationModule } from '../shared-moderation'
7import { SharedThumbnailModule } from '../shared-thumbnail' 7import { SharedThumbnailModule } from '../shared-thumbnail'
8import { SharedVideoLiveModule } from '../shared-video-live'
8import { SharedVideoPlaylistModule } from '../shared-video-playlist/shared-video-playlist.module' 9import { SharedVideoPlaylistModule } from '../shared-video-playlist/shared-video-playlist.module'
9import { VideoActionsDropdownComponent } from './video-actions-dropdown.component' 10import { VideoActionsDropdownComponent } from './video-actions-dropdown.component'
10import { VideoDownloadComponent } from './video-download.component' 11import { VideoDownloadComponent } from './video-download.component'
@@ -18,7 +19,8 @@ import { VideosSelectionComponent } from './videos-selection.component'
18 SharedModerationModule, 19 SharedModerationModule,
19 SharedVideoPlaylistModule, 20 SharedVideoPlaylistModule,
20 SharedThumbnailModule, 21 SharedThumbnailModule,
21 SharedGlobalIconModule 22 SharedGlobalIconModule,
23 SharedVideoLiveModule
22 ], 24 ],
23 25
24 declarations: [ 26 declarations: [
diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html
index 3c8271b65..00ee196ac 100644
--- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html
@@ -18,4 +18,5 @@
18 <my-video-download #videoDownloadModal></my-video-download> 18 <my-video-download #videoDownloadModal></my-video-download>
19 <my-video-report #videoReportModal [video]="video"></my-video-report> 19 <my-video-report #videoReportModal [video]="video"></my-video-report>
20 <my-video-block #videoBlockModal [video]="video" (videoBlocked)="onVideoBlocked()"></my-video-block> 20 <my-video-block #videoBlockModal [video]="video" (videoBlocked)="onVideoBlocked()"></my-video-block>
21 <my-live-stream-information #liveStreamInformationModal *ngIf="displayOptions.liveInfo"></my-live-stream-information>
21</ng-container> 22</ng-container>
diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
index 8f4c129a5..18b4a2f3c 100644
--- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
@@ -13,6 +13,7 @@ import {
13 VideoDetails, 13 VideoDetails,
14 VideoService 14 VideoService
15} from '../shared-main' 15} from '../shared-main'
16import { LiveStreamInformationComponent } from '../shared-video-live'
16import { VideoAddToPlaylistComponent } from '../shared-video-playlist' 17import { VideoAddToPlaylistComponent } from '../shared-video-playlist'
17import { VideoDownloadComponent } from './video-download.component' 18import { VideoDownloadComponent } from './video-download.component'
18 19
@@ -25,6 +26,7 @@ export type VideoActionsDisplayType = {
25 report?: boolean 26 report?: boolean
26 duplicate?: boolean 27 duplicate?: boolean
27 mute?: boolean 28 mute?: boolean
29 liveInfo?: boolean
28} 30}
29 31
30@Component({ 32@Component({
@@ -39,6 +41,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
39 @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent 41 @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent
40 @ViewChild('videoReportModal') videoReportModal: VideoReportComponent 42 @ViewChild('videoReportModal') videoReportModal: VideoReportComponent
41 @ViewChild('videoBlockModal') videoBlockModal: VideoBlockComponent 43 @ViewChild('videoBlockModal') videoBlockModal: VideoBlockComponent
44 @ViewChild('liveStreamInformationModal') liveStreamInformationModal: LiveStreamInformationComponent
42 45
43 @Input() video: Video | VideoDetails 46 @Input() video: Video | VideoDetails
44 @Input() videoCaptions: VideoCaption[] = [] 47 @Input() videoCaptions: VideoCaption[] = []
@@ -51,7 +54,8 @@ export class VideoActionsDropdownComponent implements OnChanges {
51 delete: true, 54 delete: true,
52 report: true, 55 report: true,
53 duplicate: true, 56 duplicate: true,
54 mute: true 57 mute: true,
58 liveInfo: false
55 } 59 }
56 @Input() placement = 'left' 60 @Input() placement = 'left'
57 61
@@ -127,6 +131,12 @@ export class VideoActionsDropdownComponent implements OnChanges {
127 this.videoBlockModal.show() 131 this.videoBlockModal.show()
128 } 132 }
129 133
134 showLiveInfoModal (video: Video) {
135 this.modalOpened.emit()
136
137 this.liveStreamInformationModal.show(video)
138 }
139
130 /* Actions checker */ 140 /* Actions checker */
131 141
132 isVideoUpdatable () { 142 isVideoUpdatable () {
@@ -145,6 +155,10 @@ export class VideoActionsDropdownComponent implements OnChanges {
145 return this.video.isUnblockableBy(this.user) 155 return this.video.isUnblockableBy(this.user)
146 } 156 }
147 157
158 isVideoLiveInfoAvailable () {
159 return this.video.isLiveInfoAvailableBy(this.user)
160 }
161
148 isVideoDownloadable () { 162 isVideoDownloadable () {
149 return this.video && 163 return this.video &&
150 this.video.isLive !== true && 164 this.video.isLive !== true &&
@@ -261,6 +275,12 @@ export class VideoActionsDropdownComponent implements OnChanges {
261 iconName: 'download' 275 iconName: 'download'
262 }, 276 },
263 { 277 {
278 label: $localize`Display live information`,
279 handler: ({ video }) => this.showLiveInfoModal(video),
280 isDisplayed: () => this.isVideoLiveInfoAvailable(),
281 iconName: 'live'
282 },
283 {
264 label: $localize`Update`, 284 label: $localize`Update`,
265 linkBuilder: ({ video }) => [ '/videos/update', video.uuid ], 285 linkBuilder: ({ video }) => [ '/videos/update', video.uuid ],
266 iconName: 'edit', 286 iconName: 'edit',