aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-19 15:17:43 +0100
committerChocobozzz <me@florianbigard.com>2017-12-19 15:17:43 +0100
commit85414add64d2215a44866471913a8470638742e4 (patch)
tree3612797b9e155c6c9df059cbdd11a0a7a1fcf011 /client/src/assets/player
parent232f04c809bf25952b790da5685b36f05cb19750 (diff)
downloadPeerTube-85414add64d2215a44866471913a8470638742e4.tar.gz
PeerTube-85414add64d2215a44866471913a8470638742e4.tar.zst
PeerTube-85414add64d2215a44866471913a8470638742e4.zip
Fix player play exception on chromium
Diffstat (limited to 'client/src/assets/player')
-rw-r--r--client/src/assets/player/peertube-videojs-plugin.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts
index d9dc2615b..8c131c9e9 100644
--- a/client/src/assets/player/peertube-videojs-plugin.ts
+++ b/client/src/assets/player/peertube-videojs-plugin.ts
@@ -235,9 +235,7 @@ const peertubePlugin = function (options: PeertubePluginOptions) {
235 if (err) return handleError(err) 235 if (err) return handleError(err)
236 236
237 this.renderer = renderer 237 this.renderer = renderer
238 player.play() 238 player.play().then(done)
239
240 return done()
241 }) 239 })
242 }) 240 })
243 241
@@ -323,10 +321,14 @@ const peertubePlugin = function (options: PeertubePluginOptions) {
323 player.updateVideoFile() 321 player.updateVideoFile()
324 } else { 322 } else {
325 player.one('play', () => { 323 player.one('play', () => {
326 // Pause, we wait the video to load before 324 // On firefox, we need to wait to load the video before playing
327 player.pause() 325 if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1) {
328 326 player.pause()
329 player.updateVideoFile(undefined, () => player.play()) 327 player.updateVideoFile(undefined, () => player.play())
328 return
329 }
330
331 player.updateVideoFile(undefined)
330 }) 332 })
331 } 333 }
332 334