]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add live info in watch page
authorChocobozzz <me@florianbigard.com>
Thu, 5 Nov 2020 09:56:23 +0000 (10:56 +0100)
committerChocobozzz <chocobozzz@cpy.re>
Mon, 9 Nov 2020 14:33:04 +0000 (15:33 +0100)
22 files changed:
client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
client/src/app/+my-account/my-account.module.ts
client/src/app/+videos/+video-edit/shared/video-edit.module.ts
client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.html
client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
client/src/app/+videos/+video-edit/video-update.component.ts
client/src/app/+videos/+video-edit/video-update.resolver.ts
client/src/app/+videos/+video-watch/video-watch.component.html
client/src/app/+videos/+video-watch/video-watch.component.scss
client/src/app/+videos/+video-watch/video-watch.component.ts
client/src/app/shared/shared-main/shared-main.module.ts
client/src/app/shared/shared-main/video/index.ts
client/src/app/shared/shared-main/video/video.model.ts
client/src/app/shared/shared-video-live/index.ts [new file with mode: 0644]
client/src/app/shared/shared-video-live/live-stream-information.component.html [moved from client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.html with 100% similarity]
client/src/app/shared/shared-video-live/live-stream-information.component.scss [moved from client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.scss with 100% similarity]
client/src/app/shared/shared-video-live/live-stream-information.component.ts [moved from client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.ts with 90% similarity]
client/src/app/shared/shared-video-live/live-video.service.ts [moved from client/src/app/shared/shared-main/video/live-video.service.ts with 94% similarity]
client/src/app/shared/shared-video-live/shared-video-live.module.ts [new file with mode: 0644]
client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts
client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html
client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts

index 7a30192396411a115db1b93f927555529617db74..84f022ad29b7afb6b97626f70a07e516160869b7 100644 (file)
@@ -6,10 +6,10 @@ import { AuthService, ComponentPagination, ConfirmService, Notifier, ScreenServi
 import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
 import { immutableAssign } from '@app/helpers'
 import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
 import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
 import { immutableAssign } from '@app/helpers'
 import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
+import { LiveStreamInformationComponent } from '@app/shared/shared-video-live'
 import { MiniatureDisplayOptions, OwnerDisplayType, SelectionType, VideosSelectionComponent } from '@app/shared/shared-video-miniature'
 import { VideoSortField } from '@shared/models'
 import { VideoChangeOwnershipComponent } from './modals/video-change-ownership.component'
 import { MiniatureDisplayOptions, OwnerDisplayType, SelectionType, VideosSelectionComponent } from '@app/shared/shared-video-miniature'
 import { VideoSortField } from '@shared/models'
 import { VideoChangeOwnershipComponent } from './modals/video-change-ownership.component'
-import { LiveStreamInformationComponent } from './modals/live-stream-information.component'
 
 @Component({
   selector: 'my-account-videos',
 
 @Component({
   selector: 'my-account-videos',
index 6b8baff5279c7dd5cac821fe344b487195e07e7e..6d21fff7224f85a19979da942337c3147780ea40 100644 (file)
@@ -6,6 +6,7 @@ import { NgModule } from '@angular/core'
 import { SharedAbuseListModule } from '@app/shared/shared-abuse-list'
 import { SharedFormModule } from '@app/shared/shared-forms'
 import { SharedGlobalIconModule } from '@app/shared/shared-icons'
 import { SharedAbuseListModule } from '@app/shared/shared-abuse-list'
 import { SharedFormModule } from '@app/shared/shared-forms'
 import { SharedGlobalIconModule } from '@app/shared/shared-icons'
+import { SharedVideoLiveModule } from '@app/shared/shared-video-live'
 import { SharedMainModule } from '@app/shared/shared-main'
 import { SharedModerationModule } from '@app/shared/shared-moderation'
 import { SharedShareModal } from '@app/shared/shared-share-modal'
 import { SharedMainModule } from '@app/shared/shared-main'
 import { SharedModerationModule } from '@app/shared/shared-moderation'
 import { SharedShareModal } from '@app/shared/shared-share-modal'
@@ -33,9 +34,8 @@ import { MyAccountVideoPlaylistCreateComponent } from './my-account-video-playli
 import { MyAccountVideoPlaylistElementsComponent } from './my-account-video-playlists/my-account-video-playlist-elements.component'
 import { MyAccountVideoPlaylistUpdateComponent } from './my-account-video-playlists/my-account-video-playlist-update.component'
 import { MyAccountVideoPlaylistsComponent } from './my-account-video-playlists/my-account-video-playlists.component'
 import { MyAccountVideoPlaylistElementsComponent } from './my-account-video-playlists/my-account-video-playlist-elements.component'
 import { MyAccountVideoPlaylistUpdateComponent } from './my-account-video-playlists/my-account-video-playlist-update.component'
 import { MyAccountVideoPlaylistsComponent } from './my-account-video-playlists/my-account-video-playlists.component'
-import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component'
 import { VideoChangeOwnershipComponent } from './my-account-videos/modals/video-change-ownership.component'
 import { VideoChangeOwnershipComponent } from './my-account-videos/modals/video-change-ownership.component'
-import { LiveStreamInformationComponent } from './my-account-videos/modals/live-stream-information.component'
+import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component'
 import { MyAccountComponent } from './my-account.component'
 
 @NgModule({
 import { MyAccountComponent } from './my-account.component'
 
 @NgModule({
@@ -56,7 +56,8 @@ import { MyAccountComponent } from './my-account.component'
     SharedUserInterfaceSettingsModule,
     SharedGlobalIconModule,
     SharedAbuseListModule,
     SharedUserInterfaceSettingsModule,
     SharedGlobalIconModule,
     SharedAbuseListModule,
-    SharedShareModal
+    SharedShareModal,
+    SharedVideoLiveModule
   ],
 
   declarations: [
   ],
 
   declarations: [
@@ -69,7 +70,6 @@ import { MyAccountComponent } from './my-account.component'
     MyAccountVideosComponent,
 
     VideoChangeOwnershipComponent,
     MyAccountVideosComponent,
 
     VideoChangeOwnershipComponent,
-    LiveStreamInformationComponent,
 
     MyAccountOwnershipComponent,
     MyAccountAcceptOwnershipComponent,
 
     MyAccountOwnershipComponent,
     MyAccountAcceptOwnershipComponent,
index 5931141814290533f5c185b18f10f56d55377f32..7a3854065fefbd5fb97e19425c8499a3bb5c3991 100644 (file)
@@ -3,6 +3,7 @@ import { NgModule } from '@angular/core'
 import { SharedFormModule } from '@app/shared/shared-forms'
 import { SharedGlobalIconModule } from '@app/shared/shared-icons'
 import { SharedMainModule } from '@app/shared/shared-main'
 import { SharedFormModule } from '@app/shared/shared-forms'
 import { SharedGlobalIconModule } from '@app/shared/shared-icons'
 import { SharedMainModule } from '@app/shared/shared-main'
+import { SharedVideoLiveModule } from '@app/shared/shared-video-live'
 import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service'
 import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component'
 import { VideoEditComponent } from './video-edit.component'
 import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service'
 import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component'
 import { VideoEditComponent } from './video-edit.component'
@@ -13,7 +14,8 @@ import { VideoEditComponent } from './video-edit.component'
 
     SharedMainModule,
     SharedFormModule,
 
     SharedMainModule,
     SharedFormModule,
-    SharedGlobalIconModule
+    SharedGlobalIconModule,
+    SharedVideoLiveModule
   ],
 
   declarations: [
   ],
 
   declarations: [
index 5657827a92acbf770069aa464836fce228743444..2ec82597848256914d45164c04284bbf317f0aa5 100644 (file)
@@ -35,7 +35,8 @@
 <!-- Hidden because we want to load the component -->
 <form [hidden]="!isInUpdateForm" novalidate [formGroup]="form">
   <my-video-edit
 <!-- Hidden because we want to load the component -->
 <form [hidden]="!isInUpdateForm" novalidate [formGroup]="form">
   <my-video-edit
-    [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions" [schedulePublicationPossible]="false"
+    [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions"
+    [schedulePublicationPossible]="false" [waitTranscodingEnabled]="false"
     [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels" [liveVideo]="liveVideo"
     type="go-live"
   ></my-video-edit>
     [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels" [liveVideo]="liveVideo"
     type="go-live"
   ></my-video-edit>
index 870a70d3d6e8c8f9f897b55394530197e5afe306..d29b2da97e06d58f031415bee4588a9e12d9faa8 100644 (file)
@@ -5,7 +5,8 @@ import { Router } from '@angular/router'
 import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@app/core'
 import { scrollToTop } from '@app/helpers'
 import { FormValidatorService } from '@app/shared/shared-forms'
 import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@app/core'
 import { scrollToTop } from '@app/helpers'
 import { FormValidatorService } from '@app/shared/shared-forms'
-import { LiveVideoService, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
+import { VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
+import { LiveVideoService } from '@app/shared/shared-video-live'
 import { LoadingBarService } from '@ngx-loading-bar/core'
 import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, ServerErrorCode, VideoPrivacy } from '@shared/models'
 import { VideoSend } from './video-send'
 import { LoadingBarService } from '@ngx-loading-bar/core'
 import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, ServerErrorCode, VideoPrivacy } from '@shared/models'
 import { VideoSend } from './video-send'
@@ -64,8 +65,6 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, CanCompon
       channelId: this.firstStepChannelId
     }
 
       channelId: this.firstStepChannelId
     }
 
-    this.firstStepDone.emit(name)
-
     // Go live in private mode, but correctly fill the update form with the first user choice
     const toPatch = Object.assign({}, video, { privacy: this.firstStepPrivacyId })
     this.form.patchValue(toPatch)
     // Go live in private mode, but correctly fill the update form with the first user choice
     const toPatch = Object.assign({}, video, { privacy: this.firstStepPrivacyId })
     this.form.patchValue(toPatch)
@@ -76,6 +75,8 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, CanCompon
         this.videoUUID = res.video.uuid
         this.isInUpdateForm = true
 
         this.videoUUID = res.video.uuid
         this.isInUpdateForm = true
 
+        this.firstStepDone.emit(name)
+
         this.fetchVideoLive()
       },
 
         this.fetchVideoLive()
       },
 
index 7126ad05be5007fe85f040acd4af3aca9155ecd9..e37163ca95c3a358c1c2f57791228d67c6625db8 100644 (file)
@@ -1,13 +1,14 @@
+import { of } from 'rxjs'
 import { map, switchMap } from 'rxjs/operators'
 import { Component, HostListener, OnInit } from '@angular/core'
 import { ActivatedRoute, Router } from '@angular/router'
 import { Notifier } from '@app/core'
 import { FormReactive, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms'
 import { map, switchMap } from 'rxjs/operators'
 import { Component, HostListener, OnInit } from '@angular/core'
 import { ActivatedRoute, Router } from '@angular/router'
 import { Notifier } from '@app/core'
 import { FormReactive, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms'
-import { LiveVideoService, VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main'
+import { VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main'
+import { LiveVideoService } from '@app/shared/shared-video-live'
 import { LoadingBarService } from '@ngx-loading-bar/core'
 import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models'
 import { hydrateFormFromVideo } from './shared/video-edit-utils'
 import { LoadingBarService } from '@ngx-loading-bar/core'
 import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models'
 import { hydrateFormFromVideo } from './shared/video-edit-utils'
-import { of } from 'rxjs'
 
 @Component({
   selector: 'my-videos-update',
 
 @Component({
   selector: 'my-videos-update',
index 5388a64b0899288d7b19cdeff9ce7dcf86d89fb5..276548b797a18cd202d6c7673e7d6520e30652b6 100644 (file)
@@ -2,7 +2,8 @@ import { forkJoin, of } from 'rxjs'
 import { map, switchMap } from 'rxjs/operators'
 import { Injectable } from '@angular/core'
 import { ActivatedRouteSnapshot, Resolve } from '@angular/router'
 import { map, switchMap } from 'rxjs/operators'
 import { Injectable } from '@angular/core'
 import { ActivatedRouteSnapshot, Resolve } from '@angular/router'
-import { VideoCaptionService, VideoChannelService, VideoDetails, LiveVideoService, VideoService } from '@app/shared/shared-main'
+import { VideoCaptionService, VideoChannelService, VideoDetails, VideoService } from '@app/shared/shared-main'
+import { LiveVideoService } from '@app/shared/shared-video-live'
 
 @Injectable()
 export class VideoUpdateResolver implements Resolve<any> {
 
 @Injectable()
 export class VideoUpdateResolver implements Resolve<any> {
index 74c82fbfd821377535f919a50c1adf04f17731c4..daee4be2a08f285656cb4e2eacbace946ebdc7fd 100644 (file)
                   <ng-container *ngIf="isUserLoggedIn()">
                     <my-video-actions-dropdown
                       placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions"
                   <ng-container *ngIf="isUserLoggedIn()">
                     <my-video-actions-dropdown
                       placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions"
-                      (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()"
+                      [displayOptions]="videoActionsOptions" (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()"
                     ></my-video-actions-dropdown>
                   </ng-container>
                 </div>
                     ></my-video-actions-dropdown>
                   </ng-container>
                 </div>
index 71202214114cab8a197fd9c79b5b619b6fe4eaa1..e198a8bb00dd95f4614e8e3c6a4d917d198690e8 100644 (file)
@@ -27,14 +27,14 @@ $video-info-margin-left: 44px;
     flex-direction: column;
     justify-content: center;
 
     flex-direction: column;
     justify-content: center;
 
+    $height: calc(100vh - #{$header-height} - #{$theater-bottom-space});
+
     #videojs-wrapper {
       width: 100%;
     #videojs-wrapper {
       width: 100%;
-      height: auto;
+      height: $height;
     }
 
     ::ng-deep .video-js {
     }
 
     ::ng-deep .video-js {
-      $height: calc(100vh - #{$header-height} - #{$theater-bottom-space});
-
       height: $height;
       width: 100%;
       max-width: initial;
       height: $height;
       width: 100%;
       max-width: initial;
index 9a34397312163581ba160d553f94f47ea8f0b817..48623cae0d376573b0d5872264dac80a0281cfdc 100644 (file)
@@ -21,7 +21,7 @@ import { isXPercentInViewport, scrollToTop } from '@app/helpers'
 import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main'
 import { VideoShareComponent } from '@app/shared/shared-share-modal'
 import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
 import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main'
 import { VideoShareComponent } from '@app/shared/shared-share-modal'
 import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
-import { VideoDownloadComponent } from '@app/shared/shared-video-miniature'
+import { VideoActionsDisplayType, VideoDownloadComponent } from '@app/shared/shared-video-miniature'
 import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
 import { MetaService } from '@ngx-meta/core'
 import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
 import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
 import { MetaService } from '@ngx-meta/core'
 import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
@@ -82,6 +82,18 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
   tooltipSupport = ''
   tooltipSaveToPlaylist = ''
 
   tooltipSupport = ''
   tooltipSaveToPlaylist = ''
 
+  videoActionsOptions: VideoActionsDisplayType = {
+    playlist: false,
+    download: true,
+    update: true,
+    blacklist: true,
+    delete: true,
+    report: true,
+    duplicate: true,
+    mute: true,
+    liveInfo: true
+  }
+
   private nextVideoUuid = ''
   private nextVideoTitle = ''
   private currentTime: number
   private nextVideoUuid = ''
   private nextVideoTitle = ''
   private currentTime: number
index 3816cab19b9eff9836254e93e64959b1a80c3d4d..be06303958aa5d0b4703682133a8d6efe8e798fd 100644 (file)
@@ -30,7 +30,7 @@ import { FeedComponent } from './feeds'
 import { LoaderComponent, SmallLoaderComponent } from './loaders'
 import { HelpComponent, ListOverflowComponent, TopMenuDropdownComponent } from './misc'
 import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users'
 import { LoaderComponent, SmallLoaderComponent } from './loaders'
 import { HelpComponent, ListOverflowComponent, TopMenuDropdownComponent } from './misc'
 import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users'
-import { LiveVideoService, RedundancyService, VideoImportService, VideoOwnershipService, VideoService } from './video'
+import { RedundancyService, VideoImportService, VideoOwnershipService, VideoService } from './video'
 import { VideoCaptionService } from './video-caption'
 import { VideoChannelService } from './video-channel'
 
 import { VideoCaptionService } from './video-caption'
 import { VideoChannelService } from './video-channel'
 
@@ -152,7 +152,6 @@ import { VideoChannelService } from './video-channel'
     RedundancyService,
     VideoImportService,
     VideoOwnershipService,
     RedundancyService,
     VideoImportService,
     VideoOwnershipService,
-    LiveVideoService,
     VideoService,
 
     VideoCaptionService,
     VideoService,
 
     VideoCaptionService,
index f69089517def940a00ce7f3b6b4eb726576a149b..3053df4ef539f0747e58b0068eed68419b68f10c 100644 (file)
@@ -1,4 +1,3 @@
-export * from './live-video.service'
 export * from './redundancy.service'
 export * from './video-details.model'
 export * from './video-edit.model'
 export * from './redundancy.service'
 export * from './video-details.model'
 export * from './video-edit.model'
index e3a52af3d151a2a001acaf14b33d5ab7a8128d6e..92f5bc0c07c3b2696a95ad8d544f5ab5fd6227b5 100644 (file)
@@ -193,6 +193,11 @@ export class Video implements VideoServerModel {
     return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.UPDATE_ANY_VIDEO))
   }
 
     return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.UPDATE_ANY_VIDEO))
   }
 
+  isLiveInfoAvailableBy (user: AuthUser) {
+    return this.isLive &&
+      user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.GET_ANY_LIVE))
+  }
+
   canBeDuplicatedBy (user: AuthUser) {
     return user && this.isLocal === false && user.hasRight(UserRight.MANAGE_VIDEOS_REDUNDANCIES)
   }
   canBeDuplicatedBy (user: AuthUser) {
     return user && this.isLocal === false && user.hasRight(UserRight.MANAGE_VIDEOS_REDUNDANCIES)
   }
diff --git a/client/src/app/shared/shared-video-live/index.ts b/client/src/app/shared/shared-video-live/index.ts
new file mode 100644 (file)
index 0000000..c4048e7
--- /dev/null
@@ -0,0 +1,4 @@
+export * from './live-video.service'
+export * from './live-stream-information.component'
+
+export * from './shared-video-live.module'
similarity index 90%
rename from client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.ts
rename to client/src/app/shared/shared-video-live/live-stream-information.component.ts
index a5885a8e7989f1e35c8bd7d4f72c64e51eb5ad7b..e6142eb2e279bfba64b92a8c1c3891d878a49bd2 100644 (file)
@@ -1,6 +1,7 @@
 import { Component, ElementRef, ViewChild } from '@angular/core'
 import { Component, ElementRef, ViewChild } from '@angular/core'
-import { LiveVideoService, Video } from '@app/shared/shared-main'
+import { Video } from '@app/shared/shared-main'
 import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
 import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
+import { LiveVideoService } from './live-video.service'
 
 @Component({
   selector: 'my-live-stream-information',
 
 @Component({
   selector: 'my-live-stream-information',
similarity index 94%
rename from client/src/app/shared/shared-main/video/live-video.service.ts
rename to client/src/app/shared/shared-video-live/live-video.service.ts
index 093d65e83910b18d3c77a88fc33622950ca908b9..b02442eae2df984b1516e3ccf931ea88e64bded6 100644 (file)
@@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http'
 import { Injectable } from '@angular/core'
 import { RestExtractor } from '@app/core'
 import { LiveVideo, LiveVideoCreate, LiveVideoUpdate } from '@shared/models'
 import { Injectable } from '@angular/core'
 import { RestExtractor } from '@app/core'
 import { LiveVideo, LiveVideoCreate, LiveVideoUpdate } from '@shared/models'
-import { environment } from '../../../../environments/environment'
+import { environment } from '../../../environments/environment'
 
 @Injectable()
 export class LiveVideoService {
 
 @Injectable()
 export class LiveVideoService {
diff --git a/client/src/app/shared/shared-video-live/shared-video-live.module.ts b/client/src/app/shared/shared-video-live/shared-video-live.module.ts
new file mode 100644 (file)
index 0000000..c35c2ca
--- /dev/null
@@ -0,0 +1,28 @@
+
+import { NgModule } from '@angular/core'
+import { SharedFormModule } from '../shared-forms'
+import { SharedGlobalIconModule } from '../shared-icons'
+import { SharedMainModule } from '../shared-main/shared-main.module'
+import { LiveStreamInformationComponent } from './live-stream-information.component'
+import { LiveVideoService } from './live-video.service'
+
+@NgModule({
+  imports: [
+    SharedMainModule,
+    SharedFormModule,
+    SharedGlobalIconModule
+  ],
+
+  declarations: [
+    LiveStreamInformationComponent
+  ],
+
+  exports: [
+    LiveStreamInformationComponent
+  ],
+
+  providers: [
+    LiveVideoService
+  ]
+})
+export class SharedVideoLiveModule { }
index 66614486400b5212ab9a4697bece5a255a26bcf6..08c8da3dd6f8cc9e7a86976764f739c053d2cdc5 100644 (file)
@@ -5,6 +5,7 @@ import { SharedGlobalIconModule } from '../shared-icons'
 import { SharedMainModule } from '../shared-main/shared-main.module'
 import { SharedModerationModule } from '../shared-moderation'
 import { SharedThumbnailModule } from '../shared-thumbnail'
 import { SharedMainModule } from '../shared-main/shared-main.module'
 import { SharedModerationModule } from '../shared-moderation'
 import { SharedThumbnailModule } from '../shared-thumbnail'
+import { SharedVideoLiveModule } from '../shared-video-live'
 import { SharedVideoPlaylistModule } from '../shared-video-playlist/shared-video-playlist.module'
 import { VideoActionsDropdownComponent } from './video-actions-dropdown.component'
 import { VideoDownloadComponent } from './video-download.component'
 import { SharedVideoPlaylistModule } from '../shared-video-playlist/shared-video-playlist.module'
 import { VideoActionsDropdownComponent } from './video-actions-dropdown.component'
 import { VideoDownloadComponent } from './video-download.component'
@@ -18,7 +19,8 @@ import { VideosSelectionComponent } from './videos-selection.component'
     SharedModerationModule,
     SharedVideoPlaylistModule,
     SharedThumbnailModule,
     SharedModerationModule,
     SharedVideoPlaylistModule,
     SharedThumbnailModule,
-    SharedGlobalIconModule
+    SharedGlobalIconModule,
+    SharedVideoLiveModule
   ],
 
   declarations: [
   ],
 
   declarations: [
index 3c8271b655168cdca732f0a43a669c4c4af72af5..00ee196ac9cf9a0f774b32702a608a21d1f21dcd 100644 (file)
@@ -18,4 +18,5 @@
   <my-video-download #videoDownloadModal></my-video-download>
   <my-video-report #videoReportModal [video]="video"></my-video-report>
   <my-video-block #videoBlockModal [video]="video" (videoBlocked)="onVideoBlocked()"></my-video-block>
   <my-video-download #videoDownloadModal></my-video-download>
   <my-video-report #videoReportModal [video]="video"></my-video-report>
   <my-video-block #videoBlockModal [video]="video" (videoBlocked)="onVideoBlocked()"></my-video-block>
+  <my-live-stream-information #liveStreamInformationModal *ngIf="displayOptions.liveInfo"></my-live-stream-information>
 </ng-container>
 </ng-container>
index 8f4c129a5c92b650f0a1912e543fe14487aaf7ad..18b4a2f3c2e112b38e125b061ed1a02ece256de7 100644 (file)
@@ -13,6 +13,7 @@ import {
   VideoDetails,
   VideoService
 } from '../shared-main'
   VideoDetails,
   VideoService
 } from '../shared-main'
+import { LiveStreamInformationComponent } from '../shared-video-live'
 import { VideoAddToPlaylistComponent } from '../shared-video-playlist'
 import { VideoDownloadComponent } from './video-download.component'
 
 import { VideoAddToPlaylistComponent } from '../shared-video-playlist'
 import { VideoDownloadComponent } from './video-download.component'
 
@@ -25,6 +26,7 @@ export type VideoActionsDisplayType = {
   report?: boolean
   duplicate?: boolean
   mute?: boolean
   report?: boolean
   duplicate?: boolean
   mute?: boolean
+  liveInfo?: boolean
 }
 
 @Component({
 }
 
 @Component({
@@ -39,6 +41,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
   @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent
   @ViewChild('videoReportModal') videoReportModal: VideoReportComponent
   @ViewChild('videoBlockModal') videoBlockModal: VideoBlockComponent
   @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent
   @ViewChild('videoReportModal') videoReportModal: VideoReportComponent
   @ViewChild('videoBlockModal') videoBlockModal: VideoBlockComponent
+  @ViewChild('liveStreamInformationModal') liveStreamInformationModal: LiveStreamInformationComponent
 
   @Input() video: Video | VideoDetails
   @Input() videoCaptions: VideoCaption[] = []
 
   @Input() video: Video | VideoDetails
   @Input() videoCaptions: VideoCaption[] = []
@@ -51,7 +54,8 @@ export class VideoActionsDropdownComponent implements OnChanges {
     delete: true,
     report: true,
     duplicate: true,
     delete: true,
     report: true,
     duplicate: true,
-    mute: true
+    mute: true,
+    liveInfo: false
   }
   @Input() placement = 'left'
 
   }
   @Input() placement = 'left'
 
@@ -127,6 +131,12 @@ export class VideoActionsDropdownComponent implements OnChanges {
     this.videoBlockModal.show()
   }
 
     this.videoBlockModal.show()
   }
 
+  showLiveInfoModal (video: Video) {
+    this.modalOpened.emit()
+
+    this.liveStreamInformationModal.show(video)
+  }
+
   /* Actions checker */
 
   isVideoUpdatable () {
   /* Actions checker */
 
   isVideoUpdatable () {
@@ -145,6 +155,10 @@ export class VideoActionsDropdownComponent implements OnChanges {
     return this.video.isUnblockableBy(this.user)
   }
 
     return this.video.isUnblockableBy(this.user)
   }
 
+  isVideoLiveInfoAvailable () {
+    return this.video.isLiveInfoAvailableBy(this.user)
+  }
+
   isVideoDownloadable () {
     return this.video &&
       this.video.isLive !== true &&
   isVideoDownloadable () {
     return this.video &&
       this.video.isLive !== true &&
@@ -260,6 +274,12 @@ export class VideoActionsDropdownComponent implements OnChanges {
           isDisplayed: () => this.displayOptions.download && this.isVideoDownloadable(),
           iconName: 'download'
         },
           isDisplayed: () => this.displayOptions.download && this.isVideoDownloadable(),
           iconName: 'download'
         },
+        {
+          label: $localize`Display live information`,
+          handler: ({ video }) => this.showLiveInfoModal(video),
+          isDisplayed: () => this.isVideoLiveInfoAvailable(),
+          iconName: 'live'
+        },
         {
           label: $localize`Update`,
           linkBuilder: ({ video }) => [ '/videos/update', video.uuid ],
         {
           label: $localize`Update`,
           linkBuilder: ({ video }) => [ '/videos/update', video.uuid ],