diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts index 5db7a2e55..9663d90a2 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 db969024d..e12e8c503 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') })