diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-26 15:29:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-26 15:29:04 +0200 |
commit | 0dcf9a14be3f8668fe5ee65cf0365d457b4d1499 (patch) | |
tree | b6f4fa890acdd7dc169c78290069f968ba9dc7f6 /client/src/assets/player/video-renderer.ts | |
parent | 27d56b545323fd8e8fab545466bcf3002f9c42f0 (diff) | |
download | PeerTube-0dcf9a14be3f8668fe5ee65cf0365d457b4d1499.tar.gz PeerTube-0dcf9a14be3f8668fe5ee65cf0365d457b4d1499.tar.zst PeerTube-0dcf9a14be3f8668fe5ee65cf0365d457b4d1499.zip |
Fix player error when the media is not supported
Diffstat (limited to 'client/src/assets/player/video-renderer.ts')
-rw-r--r-- | client/src/assets/player/video-renderer.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/client/src/assets/player/video-renderer.ts b/client/src/assets/player/video-renderer.ts index e3415abd3..4affb43cf 100644 --- a/client/src/assets/player/video-renderer.ts +++ b/client/src/assets/player/video-renderer.ts | |||
@@ -58,13 +58,11 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, ca | |||
58 | const codecs = getCodec(file.name, useVP9) | 58 | const codecs = getCodec(file.name, useVP9) |
59 | 59 | ||
60 | prepareElem() | 60 | prepareElem() |
61 | preparedElem.addEventListener('error', function onError(err) { | 61 | preparedElem.addEventListener('error', function onError (err) { |
62 | // Try with vp9 before returning an error | 62 | preparedElem.removeEventListener('error', onError) |
63 | if (codecs.indexOf('vp8') !== -1) { | ||
64 | preparedElem.removeEventListener('error', onError) | ||
65 | 63 | ||
66 | return fallbackToMediaSource(true) | 64 | // Try with vp9 before returning an error |
67 | } | 65 | if (codecs.indexOf('vp8') !== -1) return fallbackToMediaSource(true) |
68 | 66 | ||
69 | return callback(err) | 67 | return callback(err) |
70 | }) | 68 | }) |