diff options
22 files changed, 102 insertions, 25 deletions
diff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts index 7a3019239..84f022ad2 100644 --- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts +++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts | |||
@@ -6,10 +6,10 @@ import { AuthService, ComponentPagination, ConfirmService, Notifier, ScreenServi | |||
6 | import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' | 6 | import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' |
7 | import { immutableAssign } from '@app/helpers' | 7 | import { immutableAssign } from '@app/helpers' |
8 | import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' | 8 | import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' |
9 | import { LiveStreamInformationComponent } from '@app/shared/shared-video-live' | ||
9 | import { MiniatureDisplayOptions, OwnerDisplayType, SelectionType, VideosSelectionComponent } from '@app/shared/shared-video-miniature' | 10 | import { MiniatureDisplayOptions, OwnerDisplayType, SelectionType, VideosSelectionComponent } from '@app/shared/shared-video-miniature' |
10 | import { VideoSortField } from '@shared/models' | 11 | import { VideoSortField } from '@shared/models' |
11 | import { VideoChangeOwnershipComponent } from './modals/video-change-ownership.component' | 12 | import { VideoChangeOwnershipComponent } from './modals/video-change-ownership.component' |
12 | import { LiveStreamInformationComponent } from './modals/live-stream-information.component' | ||
13 | 13 | ||
14 | @Component({ | 14 | @Component({ |
15 | selector: 'my-account-videos', | 15 | selector: 'my-account-videos', |
diff --git a/client/src/app/+my-account/my-account.module.ts b/client/src/app/+my-account/my-account.module.ts index 6b8baff52..6d21fff72 100644 --- a/client/src/app/+my-account/my-account.module.ts +++ b/client/src/app/+my-account/my-account.module.ts | |||
@@ -6,6 +6,7 @@ import { NgModule } from '@angular/core' | |||
6 | import { SharedAbuseListModule } from '@app/shared/shared-abuse-list' | 6 | import { SharedAbuseListModule } from '@app/shared/shared-abuse-list' |
7 | import { SharedFormModule } from '@app/shared/shared-forms' | 7 | import { SharedFormModule } from '@app/shared/shared-forms' |
8 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' | 8 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' |
9 | import { SharedVideoLiveModule } from '@app/shared/shared-video-live' | ||
9 | import { SharedMainModule } from '@app/shared/shared-main' | 10 | import { SharedMainModule } from '@app/shared/shared-main' |
10 | import { SharedModerationModule } from '@app/shared/shared-moderation' | 11 | import { SharedModerationModule } from '@app/shared/shared-moderation' |
11 | import { SharedShareModal } from '@app/shared/shared-share-modal' | 12 | import { SharedShareModal } from '@app/shared/shared-share-modal' |
@@ -33,9 +34,8 @@ import { MyAccountVideoPlaylistCreateComponent } from './my-account-video-playli | |||
33 | import { MyAccountVideoPlaylistElementsComponent } from './my-account-video-playlists/my-account-video-playlist-elements.component' | 34 | import { MyAccountVideoPlaylistElementsComponent } from './my-account-video-playlists/my-account-video-playlist-elements.component' |
34 | import { MyAccountVideoPlaylistUpdateComponent } from './my-account-video-playlists/my-account-video-playlist-update.component' | 35 | import { MyAccountVideoPlaylistUpdateComponent } from './my-account-video-playlists/my-account-video-playlist-update.component' |
35 | import { MyAccountVideoPlaylistsComponent } from './my-account-video-playlists/my-account-video-playlists.component' | 36 | import { MyAccountVideoPlaylistsComponent } from './my-account-video-playlists/my-account-video-playlists.component' |
36 | import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component' | ||
37 | import { VideoChangeOwnershipComponent } from './my-account-videos/modals/video-change-ownership.component' | 37 | import { VideoChangeOwnershipComponent } from './my-account-videos/modals/video-change-ownership.component' |
38 | import { LiveStreamInformationComponent } from './my-account-videos/modals/live-stream-information.component' | 38 | import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component' |
39 | import { MyAccountComponent } from './my-account.component' | 39 | import { MyAccountComponent } from './my-account.component' |
40 | 40 | ||
41 | @NgModule({ | 41 | @NgModule({ |
@@ -56,7 +56,8 @@ import { MyAccountComponent } from './my-account.component' | |||
56 | SharedUserInterfaceSettingsModule, | 56 | SharedUserInterfaceSettingsModule, |
57 | SharedGlobalIconModule, | 57 | SharedGlobalIconModule, |
58 | SharedAbuseListModule, | 58 | SharedAbuseListModule, |
59 | SharedShareModal | 59 | SharedShareModal, |
60 | SharedVideoLiveModule | ||
60 | ], | 61 | ], |
61 | 62 | ||
62 | declarations: [ | 63 | declarations: [ |
@@ -69,7 +70,6 @@ import { MyAccountComponent } from './my-account.component' | |||
69 | MyAccountVideosComponent, | 70 | MyAccountVideosComponent, |
70 | 71 | ||
71 | VideoChangeOwnershipComponent, | 72 | VideoChangeOwnershipComponent, |
72 | LiveStreamInformationComponent, | ||
73 | 73 | ||
74 | MyAccountOwnershipComponent, | 74 | MyAccountOwnershipComponent, |
75 | MyAccountAcceptOwnershipComponent, | 75 | MyAccountAcceptOwnershipComponent, |
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.module.ts b/client/src/app/+videos/+video-edit/shared/video-edit.module.ts index 593114181..7a3854065 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.module.ts +++ b/client/src/app/+videos/+video-edit/shared/video-edit.module.ts | |||
@@ -3,6 +3,7 @@ import { NgModule } from '@angular/core' | |||
3 | import { SharedFormModule } from '@app/shared/shared-forms' | 3 | import { SharedFormModule } from '@app/shared/shared-forms' |
4 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' | 4 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' |
5 | import { SharedMainModule } from '@app/shared/shared-main' | 5 | import { SharedMainModule } from '@app/shared/shared-main' |
6 | import { SharedVideoLiveModule } from '@app/shared/shared-video-live' | ||
6 | import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service' | 7 | import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service' |
7 | import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' | 8 | import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' |
8 | import { VideoEditComponent } from './video-edit.component' | 9 | import { VideoEditComponent } from './video-edit.component' |
@@ -13,7 +14,8 @@ import { VideoEditComponent } from './video-edit.component' | |||
13 | 14 | ||
14 | SharedMainModule, | 15 | SharedMainModule, |
15 | SharedFormModule, | 16 | SharedFormModule, |
16 | SharedGlobalIconModule | 17 | SharedGlobalIconModule, |
18 | SharedVideoLiveModule | ||
17 | ], | 19 | ], |
18 | 20 | ||
19 | declarations: [ | 21 | declarations: [ |
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.html b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.html index 5657827a9..2ec825978 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.html +++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.html | |||
@@ -35,7 +35,8 @@ | |||
35 | <!-- Hidden because we want to load the component --> | 35 | <!-- Hidden because we want to load the component --> |
36 | <form [hidden]="!isInUpdateForm" novalidate [formGroup]="form"> | 36 | <form [hidden]="!isInUpdateForm" novalidate [formGroup]="form"> |
37 | <my-video-edit | 37 | <my-video-edit |
38 | [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions" [schedulePublicationPossible]="false" | 38 | [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions" |
39 | [schedulePublicationPossible]="false" [waitTranscodingEnabled]="false" | ||
39 | [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels" [liveVideo]="liveVideo" | 40 | [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels" [liveVideo]="liveVideo" |
40 | type="go-live" | 41 | type="go-live" |
41 | ></my-video-edit> | 42 | ></my-video-edit> |
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts index 870a70d3d..d29b2da97 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts | |||
@@ -5,7 +5,8 @@ import { Router } from '@angular/router' | |||
5 | import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@app/core' | 5 | import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@app/core' |
6 | import { scrollToTop } from '@app/helpers' | 6 | import { scrollToTop } from '@app/helpers' |
7 | import { FormValidatorService } from '@app/shared/shared-forms' | 7 | import { FormValidatorService } from '@app/shared/shared-forms' |
8 | import { LiveVideoService, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' | 8 | import { VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' |
9 | import { LiveVideoService } from '@app/shared/shared-video-live' | ||
9 | import { LoadingBarService } from '@ngx-loading-bar/core' | 10 | import { LoadingBarService } from '@ngx-loading-bar/core' |
10 | import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, ServerErrorCode, VideoPrivacy } from '@shared/models' | 11 | import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, ServerErrorCode, VideoPrivacy } from '@shared/models' |
11 | import { VideoSend } from './video-send' | 12 | import { VideoSend } from './video-send' |
@@ -64,8 +65,6 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, CanCompon | |||
64 | channelId: this.firstStepChannelId | 65 | channelId: this.firstStepChannelId |
65 | } | 66 | } |
66 | 67 | ||
67 | this.firstStepDone.emit(name) | ||
68 | |||
69 | // Go live in private mode, but correctly fill the update form with the first user choice | 68 | // Go live in private mode, but correctly fill the update form with the first user choice |
70 | const toPatch = Object.assign({}, video, { privacy: this.firstStepPrivacyId }) | 69 | const toPatch = Object.assign({}, video, { privacy: this.firstStepPrivacyId }) |
71 | this.form.patchValue(toPatch) | 70 | this.form.patchValue(toPatch) |
@@ -76,6 +75,8 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, CanCompon | |||
76 | this.videoUUID = res.video.uuid | 75 | this.videoUUID = res.video.uuid |
77 | this.isInUpdateForm = true | 76 | this.isInUpdateForm = true |
78 | 77 | ||
78 | this.firstStepDone.emit(name) | ||
79 | |||
79 | this.fetchVideoLive() | 80 | this.fetchVideoLive() |
80 | }, | 81 | }, |
81 | 82 | ||
diff --git a/client/src/app/+videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts index 7126ad05b..e37163ca9 100644 --- a/client/src/app/+videos/+video-edit/video-update.component.ts +++ b/client/src/app/+videos/+video-edit/video-update.component.ts | |||
@@ -1,13 +1,14 @@ | |||
1 | import { of } from 'rxjs' | ||
1 | import { map, switchMap } from 'rxjs/operators' | 2 | import { map, switchMap } from 'rxjs/operators' |
2 | import { Component, HostListener, OnInit } from '@angular/core' | 3 | import { Component, HostListener, OnInit } from '@angular/core' |
3 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
4 | import { Notifier } from '@app/core' | 5 | import { Notifier } from '@app/core' |
5 | import { FormReactive, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms' | 6 | import { FormReactive, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms' |
6 | import { LiveVideoService, VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main' | 7 | import { VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main' |
8 | import { LiveVideoService } from '@app/shared/shared-video-live' | ||
7 | import { LoadingBarService } from '@ngx-loading-bar/core' | 9 | import { LoadingBarService } from '@ngx-loading-bar/core' |
8 | import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models' | 10 | import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models' |
9 | import { hydrateFormFromVideo } from './shared/video-edit-utils' | 11 | import { hydrateFormFromVideo } from './shared/video-edit-utils' |
10 | import { of } from 'rxjs' | ||
11 | 12 | ||
12 | @Component({ | 13 | @Component({ |
13 | selector: 'my-videos-update', | 14 | selector: 'my-videos-update', |
diff --git a/client/src/app/+videos/+video-edit/video-update.resolver.ts b/client/src/app/+videos/+video-edit/video-update.resolver.ts index 5388a64b0..276548b79 100644 --- a/client/src/app/+videos/+video-edit/video-update.resolver.ts +++ b/client/src/app/+videos/+video-edit/video-update.resolver.ts | |||
@@ -2,7 +2,8 @@ import { forkJoin, of } from 'rxjs' | |||
2 | import { map, switchMap } from 'rxjs/operators' | 2 | import { map, switchMap } from 'rxjs/operators' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { ActivatedRouteSnapshot, Resolve } from '@angular/router' | 4 | import { ActivatedRouteSnapshot, Resolve } from '@angular/router' |
5 | import { VideoCaptionService, VideoChannelService, VideoDetails, LiveVideoService, VideoService } from '@app/shared/shared-main' | 5 | import { VideoCaptionService, VideoChannelService, VideoDetails, VideoService } from '@app/shared/shared-main' |
6 | import { LiveVideoService } from '@app/shared/shared-video-live' | ||
6 | 7 | ||
7 | @Injectable() | 8 | @Injectable() |
8 | export class VideoUpdateResolver implements Resolve<any> { | 9 | export class VideoUpdateResolver implements Resolve<any> { |
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 74c82fbfd..daee4be2a 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.html +++ b/client/src/app/+videos/+video-watch/video-watch.component.html | |||
@@ -136,7 +136,7 @@ | |||
136 | <ng-container *ngIf="isUserLoggedIn()"> | 136 | <ng-container *ngIf="isUserLoggedIn()"> |
137 | <my-video-actions-dropdown | 137 | <my-video-actions-dropdown |
138 | placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions" | 138 | placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions" |
139 | (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()" | 139 | [displayOptions]="videoActionsOptions" (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()" |
140 | ></my-video-actions-dropdown> | 140 | ></my-video-actions-dropdown> |
141 | </ng-container> | 141 | </ng-container> |
142 | </div> | 142 | </div> |
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.scss b/client/src/app/+videos/+video-watch/video-watch.component.scss index 712022141..e198a8bb0 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.scss +++ b/client/src/app/+videos/+video-watch/video-watch.component.scss | |||
@@ -27,14 +27,14 @@ $video-info-margin-left: 44px; | |||
27 | flex-direction: column; | 27 | flex-direction: column; |
28 | justify-content: center; | 28 | justify-content: center; |
29 | 29 | ||
30 | $height: calc(100vh - #{$header-height} - #{$theater-bottom-space}); | ||
31 | |||
30 | #videojs-wrapper { | 32 | #videojs-wrapper { |
31 | width: 100%; | 33 | width: 100%; |
32 | height: auto; | 34 | height: $height; |
33 | } | 35 | } |
34 | 36 | ||
35 | ::ng-deep .video-js { | 37 | ::ng-deep .video-js { |
36 | $height: calc(100vh - #{$header-height} - #{$theater-bottom-space}); | ||
37 | |||
38 | height: $height; | 38 | height: $height; |
39 | width: 100%; | 39 | width: 100%; |
40 | max-width: initial; | 40 | max-width: initial; |
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 9a3439731..48623cae0 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts | |||
@@ -21,7 +21,7 @@ import { isXPercentInViewport, scrollToTop } from '@app/helpers' | |||
21 | import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main' | 21 | import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main' |
22 | import { VideoShareComponent } from '@app/shared/shared-share-modal' | 22 | import { VideoShareComponent } from '@app/shared/shared-share-modal' |
23 | import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' | 23 | import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' |
24 | import { VideoDownloadComponent } from '@app/shared/shared-video-miniature' | 24 | import { VideoActionsDisplayType, VideoDownloadComponent } from '@app/shared/shared-video-miniature' |
25 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' | 25 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' |
26 | import { MetaService } from '@ngx-meta/core' | 26 | import { MetaService } from '@ngx-meta/core' |
27 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' | 27 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' |
@@ -82,6 +82,18 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
82 | tooltipSupport = '' | 82 | tooltipSupport = '' |
83 | tooltipSaveToPlaylist = '' | 83 | tooltipSaveToPlaylist = '' |
84 | 84 | ||
85 | videoActionsOptions: VideoActionsDisplayType = { | ||
86 | playlist: false, | ||
87 | download: true, | ||
88 | update: true, | ||
89 | blacklist: true, | ||
90 | delete: true, | ||
91 | report: true, | ||
92 | duplicate: true, | ||
93 | mute: true, | ||
94 | liveInfo: true | ||
95 | } | ||
96 | |||
85 | private nextVideoUuid = '' | 97 | private nextVideoUuid = '' |
86 | private nextVideoTitle = '' | 98 | private nextVideoTitle = '' |
87 | private currentTime: number | 99 | private currentTime: number |
diff --git a/client/src/app/shared/shared-main/shared-main.module.ts b/client/src/app/shared/shared-main/shared-main.module.ts index 3816cab19..be0630395 100644 --- a/client/src/app/shared/shared-main/shared-main.module.ts +++ b/client/src/app/shared/shared-main/shared-main.module.ts | |||
@@ -30,7 +30,7 @@ import { FeedComponent } from './feeds' | |||
30 | import { LoaderComponent, SmallLoaderComponent } from './loaders' | 30 | import { LoaderComponent, SmallLoaderComponent } from './loaders' |
31 | import { HelpComponent, ListOverflowComponent, TopMenuDropdownComponent } from './misc' | 31 | import { HelpComponent, ListOverflowComponent, TopMenuDropdownComponent } from './misc' |
32 | import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users' | 32 | import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users' |
33 | import { LiveVideoService, RedundancyService, VideoImportService, VideoOwnershipService, VideoService } from './video' | 33 | import { RedundancyService, VideoImportService, VideoOwnershipService, VideoService } from './video' |
34 | import { VideoCaptionService } from './video-caption' | 34 | import { VideoCaptionService } from './video-caption' |
35 | import { VideoChannelService } from './video-channel' | 35 | import { VideoChannelService } from './video-channel' |
36 | 36 | ||
@@ -152,7 +152,6 @@ import { VideoChannelService } from './video-channel' | |||
152 | RedundancyService, | 152 | RedundancyService, |
153 | VideoImportService, | 153 | VideoImportService, |
154 | VideoOwnershipService, | 154 | VideoOwnershipService, |
155 | LiveVideoService, | ||
156 | VideoService, | 155 | VideoService, |
157 | 156 | ||
158 | VideoCaptionService, | 157 | VideoCaptionService, |
diff --git a/client/src/app/shared/shared-main/video/index.ts b/client/src/app/shared/shared-main/video/index.ts index f69089517..3053df4ef 100644 --- a/client/src/app/shared/shared-main/video/index.ts +++ b/client/src/app/shared/shared-main/video/index.ts | |||
@@ -1,4 +1,3 @@ | |||
1 | export * from './live-video.service' | ||
2 | export * from './redundancy.service' | 1 | export * from './redundancy.service' |
3 | export * from './video-details.model' | 2 | export * from './video-details.model' |
4 | export * from './video-edit.model' | 3 | export * from './video-edit.model' |
diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts index e3a52af3d..92f5bc0c0 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts | |||
@@ -193,6 +193,11 @@ export class Video implements VideoServerModel { | |||
193 | return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.UPDATE_ANY_VIDEO)) | 193 | return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.UPDATE_ANY_VIDEO)) |
194 | } | 194 | } |
195 | 195 | ||
196 | isLiveInfoAvailableBy (user: AuthUser) { | ||
197 | return this.isLive && | ||
198 | user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.GET_ANY_LIVE)) | ||
199 | } | ||
200 | |||
196 | canBeDuplicatedBy (user: AuthUser) { | 201 | canBeDuplicatedBy (user: AuthUser) { |
197 | return user && this.isLocal === false && user.hasRight(UserRight.MANAGE_VIDEOS_REDUNDANCIES) | 202 | return user && this.isLocal === false && user.hasRight(UserRight.MANAGE_VIDEOS_REDUNDANCIES) |
198 | } | 203 | } |
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 index 000000000..c4048e7c5 --- /dev/null +++ b/client/src/app/shared/shared-video-live/index.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export * from './live-video.service' | ||
2 | export * from './live-stream-information.component' | ||
3 | |||
4 | export * from './shared-video-live.module' | ||
diff --git a/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.html b/client/src/app/shared/shared-video-live/live-stream-information.component.html index 2e65e1de9..2e65e1de9 100644 --- a/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.html +++ b/client/src/app/shared/shared-video-live/live-stream-information.component.html | |||
diff --git a/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.scss b/client/src/app/shared/shared-video-live/live-stream-information.component.scss index a79fec179..a79fec179 100644 --- a/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.scss +++ b/client/src/app/shared/shared-video-live/live-stream-information.component.scss | |||
diff --git a/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.ts b/client/src/app/shared/shared-video-live/live-stream-information.component.ts index a5885a8e7..e6142eb2e 100644 --- a/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.ts +++ b/client/src/app/shared/shared-video-live/live-stream-information.component.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { Component, ElementRef, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, ViewChild } from '@angular/core' |
2 | import { LiveVideoService, Video } from '@app/shared/shared-main' | 2 | import { Video } from '@app/shared/shared-main' |
3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
4 | import { LiveVideoService } from './live-video.service' | ||
4 | 5 | ||
5 | @Component({ | 6 | @Component({ |
6 | selector: 'my-live-stream-information', | 7 | selector: 'my-live-stream-information', |
diff --git a/client/src/app/shared/shared-main/video/live-video.service.ts b/client/src/app/shared/shared-video-live/live-video.service.ts index 093d65e83..b02442eae 100644 --- a/client/src/app/shared/shared-main/video/live-video.service.ts +++ b/client/src/app/shared/shared-video-live/live-video.service.ts | |||
@@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http' | |||
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { RestExtractor } from '@app/core' | 4 | import { RestExtractor } from '@app/core' |
5 | import { LiveVideo, LiveVideoCreate, LiveVideoUpdate } from '@shared/models' | 5 | import { LiveVideo, LiveVideoCreate, LiveVideoUpdate } from '@shared/models' |
6 | import { environment } from '../../../../environments/environment' | 6 | import { environment } from '../../../environments/environment' |
7 | 7 | ||
8 | @Injectable() | 8 | @Injectable() |
9 | export class LiveVideoService { | 9 | 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 index 000000000..c35c2caa3 --- /dev/null +++ b/client/src/app/shared/shared-video-live/shared-video-live.module.ts | |||
@@ -0,0 +1,28 @@ | |||
1 | |||
2 | import { NgModule } from '@angular/core' | ||
3 | import { SharedFormModule } from '../shared-forms' | ||
4 | import { SharedGlobalIconModule } from '../shared-icons' | ||
5 | import { SharedMainModule } from '../shared-main/shared-main.module' | ||
6 | import { LiveStreamInformationComponent } from './live-stream-information.component' | ||
7 | import { LiveVideoService } from './live-video.service' | ||
8 | |||
9 | @NgModule({ | ||
10 | imports: [ | ||
11 | SharedMainModule, | ||
12 | SharedFormModule, | ||
13 | SharedGlobalIconModule | ||
14 | ], | ||
15 | |||
16 | declarations: [ | ||
17 | LiveStreamInformationComponent | ||
18 | ], | ||
19 | |||
20 | exports: [ | ||
21 | LiveStreamInformationComponent | ||
22 | ], | ||
23 | |||
24 | providers: [ | ||
25 | LiveVideoService | ||
26 | ] | ||
27 | }) | ||
28 | export class SharedVideoLiveModule { } | ||
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' | |||
5 | import { SharedMainModule } from '../shared-main/shared-main.module' | 5 | import { SharedMainModule } from '../shared-main/shared-main.module' |
6 | import { SharedModerationModule } from '../shared-moderation' | 6 | import { SharedModerationModule } from '../shared-moderation' |
7 | import { SharedThumbnailModule } from '../shared-thumbnail' | 7 | import { SharedThumbnailModule } from '../shared-thumbnail' |
8 | import { SharedVideoLiveModule } from '../shared-video-live' | ||
8 | import { SharedVideoPlaylistModule } from '../shared-video-playlist/shared-video-playlist.module' | 9 | import { SharedVideoPlaylistModule } from '../shared-video-playlist/shared-video-playlist.module' |
9 | import { VideoActionsDropdownComponent } from './video-actions-dropdown.component' | 10 | import { VideoActionsDropdownComponent } from './video-actions-dropdown.component' |
10 | import { VideoDownloadComponent } from './video-download.component' | 11 | import { 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' |
16 | import { LiveStreamInformationComponent } from '../shared-video-live' | ||
16 | import { VideoAddToPlaylistComponent } from '../shared-video-playlist' | 17 | import { VideoAddToPlaylistComponent } from '../shared-video-playlist' |
17 | import { VideoDownloadComponent } from './video-download.component' | 18 | import { 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', |