Skip to content

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

Prevent console error with HLS fallback

Chocobozzzf746622be455
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index 5db7a2e556..9663d90a2b 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -167,7 +167,7 @@ export class PeertubePlayerManager {
}
private static async tryToRecoverHLSError (err: any, currentPlayer: videojs.Player, options: PeertubePlayerManagerOptions) {
- if (err.code === 3) { // Decode error
+ if (err.code === MediaError.MEDIA_ERR_DECODE) {
// Display a notification to user
if (this.videojsDecodeErrors === 0) {
diff --git a/client/src/assets/player/shared/upnext/upnext-plugin.ts b/client/src/assets/player/shared/upnext/upnext-plugin.ts
index db969024de..e12e8c5033 100644
--- a/client/src/assets/player/shared/upnext/upnext-plugin.ts
+++ b/client/src/assets/player/shared/upnext/upnext-plugin.ts
@@ -19,6 +19,9 @@ class UpNextPlugin extends Plugin {
super(player)
+ // UpNext plugin can be called later, so ensure the player is not disposed
+ if (this.player.isDisposed()) return
+
this.player.ready(() => {
player.addClass('vjs-upnext')
})