diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-30 17:10:00 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-30 17:10:00 +0200 |
commit | 960a11e89da4e4a6ad6fbad61c71625f89e267b6 (patch) | |
tree | 0cd370970c3166dd3715e46a5503a3da78f25e37 /client/src/assets/player/video-renderer.ts | |
parent | e10c7d5125c47830bd23ecfed2f1b2d1048e6639 (diff) | |
download | PeerTube-960a11e89da4e4a6ad6fbad61c71625f89e267b6.tar.gz PeerTube-960a11e89da4e4a6ad6fbad61c71625f89e267b6.tar.zst PeerTube-960a11e89da4e4a6ad6fbad61c71625f89e267b6.zip |
Add context menu to player
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 4b54b661a..4affb43cf 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('canplay', onLoadStart) | 53 | preparedElem.addEventListener('loadstart', 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('canplay', onLoadStart) | 69 | preparedElem.addEventListener('loadstart', 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('canplay', onLoadStart) | 98 | preparedElem.removeEventListener('loadstart', onLoadStart) |
99 | if (opts.autoplay) preparedElem.play() | 99 | if (opts.autoplay) preparedElem.play() |
100 | 100 | ||
101 | callback(null, renderer) | 101 | callback(null, renderer) |