diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-30 11:11:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-30 11:12:09 +0200 |
commit | 04bf312cdac0fe601864c19bdbd4f24c73ae08ae (patch) | |
tree | 2265582695bb2c6d6b4f2994414490c72bab782c /client/src/assets/player/video-renderer.ts | |
parent | 0c948c1659c0a6010f2bf58c402b1c9af192aa5e (diff) | |
download | PeerTube-04bf312cdac0fe601864c19bdbd4f24c73ae08ae.tar.gz PeerTube-04bf312cdac0fe601864c19bdbd4f24c73ae08ae.tar.zst PeerTube-04bf312cdac0fe601864c19bdbd4f24c73ae08ae.zip |
Improve create transcoding jobs tests
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) |