aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-videojs-plugin.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-26 15:29:04 +0200
committerChocobozzz <me@florianbigard.com>2018-03-26 15:29:04 +0200
commit0dcf9a14be3f8668fe5ee65cf0365d457b4d1499 (patch)
treeb6f4fa890acdd7dc169c78290069f968ba9dc7f6 /client/src/assets/player/peertube-videojs-plugin.ts
parent27d56b545323fd8e8fab545466bcf3002f9c42f0 (diff)
downloadPeerTube-0dcf9a14be3f8668fe5ee65cf0365d457b4d1499.tar.gz
PeerTube-0dcf9a14be3f8668fe5ee65cf0365d457b4d1499.tar.zst
PeerTube-0dcf9a14be3f8668fe5ee65cf0365d457b4d1499.zip
Fix player error when the media is not supported
Diffstat (limited to 'client/src/assets/player/peertube-videojs-plugin.ts')
-rw-r--r--client/src/assets/player/peertube-videojs-plugin.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts
index 277603c9b..52846503d 100644
--- a/client/src/assets/player/peertube-videojs-plugin.ts
+++ b/client/src/assets/player/peertube-videojs-plugin.ts
@@ -270,7 +270,7 @@ class PeerTubePlugin extends Plugin {
270 this.playerElement = options.playerElement 270 this.playerElement = options.playerElement
271 271
272 this.player.ready(() => { 272 this.player.ready(() => {
273 this.initializePlayer(options) 273 this.initializePlayer()
274 this.runTorrentInfoScheduler() 274 this.runTorrentInfoScheduler()
275 this.runViewAdd() 275 this.runViewAdd()
276 }) 276 })
@@ -331,9 +331,10 @@ class PeerTubePlugin extends Plugin {
331 331
332 const options = { autoplay: true, controls: true } 332 const options = { autoplay: true, controls: true }
333 renderVideo(torrent.files[0], this.playerElement, options,(err, renderer) => { 333 renderVideo(torrent.files[0], this.playerElement, options,(err, renderer) => {
334 this.renderer = renderer
335
334 if (err) return this.fallbackToHttp() 336 if (err) return this.fallbackToHttp()
335 337
336 this.renderer = renderer
337 if (!this.player.paused()) { 338 if (!this.player.paused()) {
338 const playPromise = this.player.play() 339 const playPromise = this.player.play()
339 if (playPromise !== undefined) return playPromise.then(done) 340 if (playPromise !== undefined) return playPromise.then(done)
@@ -406,7 +407,7 @@ class PeerTubePlugin extends Plugin {
406 this.updateVideoFile(undefined, () => this.player.play()) 407 this.updateVideoFile(undefined, () => this.player.play())
407 } 408 }
408 409
409 private initializePlayer (options: PeertubePluginOptions) { 410 private initializePlayer () {
410 if (this.autoplay === true) { 411 if (this.autoplay === true) {
411 this.updateVideoFile(undefined, () => this.player.play()) 412 this.updateVideoFile(undefined, () => this.player.play())
412 } else { 413 } else {