diff options
Diffstat (limited to 'client/src/assets/player/video-renderer.ts')
-rw-r--r-- | client/src/assets/player/video-renderer.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/src/assets/player/video-renderer.ts b/client/src/assets/player/video-renderer.ts index 4affb43cf..4b54b661a 100644 --- a/client/src/assets/player/video-renderer.ts +++ b/client/src/assets/player/video-renderer.ts | |||
@@ -50,7 +50,7 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, ca | |||
50 | 50 | ||
51 | return fallbackToMediaSource() | 51 | return fallbackToMediaSource() |
52 | }) | 52 | }) |
53 | preparedElem.addEventListener('loadstart', onLoadStart) | 53 | preparedElem.addEventListener('canplay', onLoadStart) |
54 | return videostream(file, preparedElem) | 54 | return videostream(file, preparedElem) |
55 | } | 55 | } |
56 | 56 | ||
@@ -66,7 +66,7 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, ca | |||
66 | 66 | ||
67 | return callback(err) | 67 | return callback(err) |
68 | }) | 68 | }) |
69 | preparedElem.addEventListener('loadstart', onLoadStart) | 69 | preparedElem.addEventListener('canplay', onLoadStart) |
70 | 70 | ||
71 | const wrapper = new MediaElementWrapper(preparedElem) | 71 | const wrapper = new MediaElementWrapper(preparedElem) |
72 | const writable = wrapper.createWriteStream(codecs) | 72 | const writable = wrapper.createWriteStream(codecs) |
@@ -95,7 +95,7 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, ca | |||
95 | } | 95 | } |
96 | 96 | ||
97 | function onLoadStart () { | 97 | function onLoadStart () { |
98 | preparedElem.removeEventListener('loadstart', onLoadStart) | 98 | preparedElem.removeEventListener('canplay', onLoadStart) |
99 | if (opts.autoplay) preparedElem.play() | 99 | if (opts.autoplay) preparedElem.play() |
100 | 100 | ||
101 | callback(null, renderer) | 101 | callback(null, renderer) |