aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/video-renderer.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player/video-renderer.ts')
-rw-r--r--client/src/assets/player/video-renderer.ts10
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 })