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, 0 insertions, 6 deletions
diff --git a/client/src/assets/player/video-renderer.ts b/client/src/assets/player/video-renderer.ts index 8baa42533..3cd98242d 100644 --- a/client/src/assets/player/video-renderer.ts +++ b/client/src/assets/player/video-renderer.ts | |||
@@ -43,7 +43,6 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, ca | |||
43 | prepareElem() | 43 | prepareElem() |
44 | preparedElem.addEventListener('error', fallbackToMediaSource) | 44 | preparedElem.addEventListener('error', fallbackToMediaSource) |
45 | preparedElem.addEventListener('loadstart', onLoadStart) | 45 | preparedElem.addEventListener('loadstart', onLoadStart) |
46 | preparedElem.addEventListener('canplay', onCanPlay) | ||
47 | return videostream(file, preparedElem) | 46 | return videostream(file, preparedElem) |
48 | } | 47 | } |
49 | 48 | ||
@@ -51,7 +50,6 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, ca | |||
51 | prepareElem() | 50 | prepareElem() |
52 | preparedElem.addEventListener('error', callback) | 51 | preparedElem.addEventListener('error', callback) |
53 | preparedElem.addEventListener('loadstart', onLoadStart) | 52 | preparedElem.addEventListener('loadstart', onLoadStart) |
54 | preparedElem.addEventListener('canplay', onCanPlay) | ||
55 | 53 | ||
56 | const wrapper = new MediaElementWrapper(preparedElem) | 54 | const wrapper = new MediaElementWrapper(preparedElem) |
57 | const writable = wrapper.createWriteStream(getCodec(file.name)) | 55 | const writable = wrapper.createWriteStream(getCodec(file.name)) |
@@ -64,7 +62,6 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, ca | |||
64 | 62 | ||
65 | function fallbackToMediaSource () { | 63 | function fallbackToMediaSource () { |
66 | preparedElem.removeEventListener('error', fallbackToMediaSource) | 64 | preparedElem.removeEventListener('error', fallbackToMediaSource) |
67 | preparedElem.removeEventListener('canplay', onCanPlay) | ||
68 | 65 | ||
69 | useMediaSource() | 66 | useMediaSource() |
70 | } | 67 | } |
@@ -82,10 +79,7 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, ca | |||
82 | function onLoadStart () { | 79 | function onLoadStart () { |
83 | preparedElem.removeEventListener('loadstart', onLoadStart) | 80 | preparedElem.removeEventListener('loadstart', onLoadStart) |
84 | if (opts.autoplay) preparedElem.play() | 81 | if (opts.autoplay) preparedElem.play() |
85 | } | ||
86 | 82 | ||
87 | function onCanPlay () { | ||
88 | preparedElem.removeEventListener('canplay', onCanPlay) | ||
89 | callback(null, renderer) | 83 | callback(null, renderer) |
90 | } | 84 | } |
91 | } | 85 | } |