aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/video-renderer.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-07 10:01:37 +0100
committerChocobozzz <me@florianbigard.com>2018-02-07 10:03:11 +0100
commit481d35966fe49e9a5d3442b658e35403e9464322 (patch)
tree2c44537021dc515c04f5b5c4edf31d13b30f606b /client/src/assets/player/video-renderer.ts
parent0bc22f8d7ef0ddb4becae2e9453378d3a0f88218 (diff)
downloadPeerTube-481d35966fe49e9a5d3442b658e35403e9464322.tar.gz
PeerTube-481d35966fe49e9a5d3442b658e35403e9464322.tar.zst
PeerTube-481d35966fe49e9a5d3442b658e35403e9464322.zip
Fix video play on google chrome
Diffstat (limited to 'client/src/assets/player/video-renderer.ts')
-rw-r--r--client/src/assets/player/video-renderer.ts6
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}