diff options
author | Chocobozzz <me@florianbigard.com> | 2022-10-31 10:33:37 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-10-31 10:33:37 +0100 |
commit | f746622be455309112d858105992b2fa0b01af90 (patch) | |
tree | 3cb82a714f746909790801deb9ce2b40526acc21 /client/src/assets/player | |
parent | b9b3d18dd98af76aa423eeb58127352314dce762 (diff) | |
download | PeerTube-f746622be455309112d858105992b2fa0b01af90.tar.gz PeerTube-f746622be455309112d858105992b2fa0b01af90.tar.zst PeerTube-f746622be455309112d858105992b2fa0b01af90.zip |
Prevent console error with HLS fallback
Diffstat (limited to 'client/src/assets/player')
-rw-r--r-- | client/src/assets/player/peertube-player-manager.ts | 2 | ||||
-rw-r--r-- | client/src/assets/player/shared/upnext/upnext-plugin.ts | 3 |
2 files changed, 4 insertions, 1 deletions
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 { | |||
167 | } | 167 | } |
168 | 168 | ||
169 | private static async tryToRecoverHLSError (err: any, currentPlayer: videojs.Player, options: PeertubePlayerManagerOptions) { | 169 | private static async tryToRecoverHLSError (err: any, currentPlayer: videojs.Player, options: PeertubePlayerManagerOptions) { |
170 | if (err.code === 3) { // Decode error | 170 | if (err.code === MediaError.MEDIA_ERR_DECODE) { |
171 | 171 | ||
172 | // Display a notification to user | 172 | // Display a notification to user |
173 | if (this.videojsDecodeErrors === 0) { | 173 | 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 { | |||
19 | 19 | ||
20 | super(player) | 20 | super(player) |
21 | 21 | ||
22 | // UpNext plugin can be called later, so ensure the player is not disposed | ||
23 | if (this.player.isDisposed()) return | ||
24 | |||
22 | this.player.ready(() => { | 25 | this.player.ready(() => { |
23 | player.addClass('vjs-upnext') | 26 | player.addClass('vjs-upnext') |
24 | }) | 27 | }) |