aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-06-03 14:18:28 +0200
committerChocobozzz <me@florianbigard.com>2022-06-03 14:19:30 +0200
commit5a2f775a212bcb708f1756e3780c764cc232a910 (patch)
tree1d40052e3f2b36d8d44cf12099746746effa0ba9 /client/src/app/+videos/+video-watch/shared
parent010382b6037cff5d0ed16fa8b158691439fac9b7 (diff)
downloadPeerTube-5a2f775a212bcb708f1756e3780c764cc232a910.tar.gz
PeerTube-5a2f775a212bcb708f1756e3780c764cc232a910.tar.zst
PeerTube-5a2f775a212bcb708f1756e3780c764cc232a910.zip
Handle playlist without videos available
Diffstat (limited to 'client/src/app/+videos/+video-watch/shared')
-rw-r--r--client/src/app/+videos/+video-watch/shared/information/video-alert.component.html4
-rw-r--r--client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts1
-rw-r--r--client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.html2
-rw-r--r--client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.ts5
4 files changed, 10 insertions, 2 deletions
diff --git a/client/src/app/+videos/+video-watch/shared/information/video-alert.component.html b/client/src/app/+videos/+video-watch/shared/information/video-alert.component.html
index c6ffb1abd..be726c990 100644
--- a/client/src/app/+videos/+video-watch/shared/information/video-alert.component.html
+++ b/client/src/app/+videos/+video-watch/shared/information/video-alert.component.html
@@ -34,6 +34,10 @@
34 This live has ended. 34 This live has ended.
35</div> 35</div>
36 36
37<div i18n class="alert alert-warning" *ngIf="noPlaylistVideoFound">
38 There are no videos available in this playlist.
39</div>
40
37<div class="alert alert-danger" *ngIf="video?.blacklisted"> 41<div class="alert alert-danger" *ngIf="video?.blacklisted">
38 <div class="blocked-label" i18n>This video is blocked.</div> 42 <div class="blocked-label" i18n>This video is blocked.</div>
39 {{ video.blacklistedReason }} 43 {{ video.blacklistedReason }}
diff --git a/client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts b/client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts
index 79b56705f..ba79fabc8 100644
--- a/client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts
+++ b/client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts
@@ -9,6 +9,7 @@ import { VideoState } from '@shared/models'
9}) 9})
10export class VideoAlertComponent { 10export class VideoAlertComponent {
11 @Input() video: VideoDetails 11 @Input() video: VideoDetails
12 @Input() noPlaylistVideoFound: boolean
12 13
13 isVideoToTranscode () { 14 isVideoToTranscode () {
14 return this.video && this.video.state.id === VideoState.TO_TRANSCODE 15 return this.video && this.video.state.id === VideoState.TO_TRANSCODE
diff --git a/client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.html b/client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.html
index da81d76d1..f5dd352a3 100644
--- a/client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.html
+++ b/client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.html
@@ -1,5 +1,5 @@
1<div 1<div
2 *ngIf="playlist && currentPlaylistPosition" class="playlist" 2 *ngIf="playlist && (currentPlaylistPosition || noPlaylistVideos)" class="playlist"
3 myInfiniteScroller [onItself]="true" (nearOfBottom)="onPlaylistVideosNearOfBottom()" 3 myInfiniteScroller [onItself]="true" (nearOfBottom)="onPlaylistVideosNearOfBottom()"
4> 4>
5 <div class="playlist-info"> 5 <div class="playlist-info">
diff --git a/client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.ts b/client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.ts
index 879d296a7..ec85db0ff 100644
--- a/client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.ts
+++ b/client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.ts
@@ -18,6 +18,7 @@ export class VideoWatchPlaylistComponent {
18 @Input() playlist: VideoPlaylist 18 @Input() playlist: VideoPlaylist
19 19
20 @Output() videoFound = new EventEmitter<string>() 20 @Output() videoFound = new EventEmitter<string>()
21 @Output() noVideoFound = new EventEmitter<void>()
21 22
22 playlistElements: VideoPlaylistElement[] = [] 23 playlistElements: VideoPlaylistElement[] = []
23 playlistPagination: ComponentPagination = { 24 playlistPagination: ComponentPagination = {
@@ -28,10 +29,11 @@ export class VideoWatchPlaylistComponent {
28 29
29 autoPlayNextVideoPlaylist: boolean 30 autoPlayNextVideoPlaylist: boolean
30 autoPlayNextVideoPlaylistSwitchText = '' 31 autoPlayNextVideoPlaylistSwitchText = ''
32
31 loopPlaylist: boolean 33 loopPlaylist: boolean
32 loopPlaylistSwitchText = '' 34 loopPlaylistSwitchText = ''
33 noPlaylistVideos = false
34 35
36 noPlaylistVideos = false
35 currentPlaylistPosition: number 37 currentPlaylistPosition: number
36 38
37 constructor ( 39 constructor (
@@ -100,6 +102,7 @@ export class VideoWatchPlaylistComponent {
100 const firstAvailableVideo = this.playlistElements.find(e => !!e.video) 102 const firstAvailableVideo = this.playlistElements.find(e => !!e.video)
101 if (!firstAvailableVideo) { 103 if (!firstAvailableVideo) {
102 this.noPlaylistVideos = true 104 this.noPlaylistVideos = true
105 this.noVideoFound.emit()
103 return 106 return
104 } 107 }
105 108