Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Improve messgae when playlist is empty

Chocobozzza8eb267b13b7
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts
index 9b35562976..b7906cbbc2 100644
--- a/client/src/standalone/videos/embed.ts
+++ b/client/src/standalone/videos/embed.ts
@@ -127,6 +127,11 @@ export class PeerTubeEmbed {
res.videosResponse.json() as Promise<ResultList<VideoPlaylistElement>>
])
+ if (playlist.videosLength === 0) {
+ this.playerHTML.displayError('This playlist is empty', await this.translationsPromise)
+ return undefined
+ }
+
const allPlaylistElements = await this.playlistFetcher.loadAllPlaylistVideos(playlistId, playlistElementResult)
this.playlistTracker = new PlaylistTracker(playlist, allPlaylistElements)
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts
index 6d2c8755f7..4cb9b00a71 100755
--- a/scripts/i18n/create-custom-files.ts
+++ b/scripts/i18n/create-custom-files.ts
@@ -102,7 +102,8 @@ const playerKeys = {
'(skipped {1} buffers) ': '(skipped {1} buffers) ',
'Video Filter': 'Video Filter',
'Mirror Video': 'Mirror Video',
- 'Mirror': 'Mirror'
+ 'Mirror': 'Mirror',
+ 'This playlist is empty': 'This playlist is empty'
}
Object.assign(playerKeys, videojs)