From 0dcf9a14be3f8668fe5ee65cf0365d457b4d1499 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 26 Mar 2018 15:29:04 +0200 Subject: Fix player error when the media is not supported --- client/src/assets/player/peertube-videojs-plugin.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'client/src/assets/player/peertube-videojs-plugin.ts') 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 { this.playerElement = options.playerElement this.player.ready(() => { - this.initializePlayer(options) + this.initializePlayer() this.runTorrentInfoScheduler() this.runViewAdd() }) @@ -331,9 +331,10 @@ class PeerTubePlugin extends Plugin { const options = { autoplay: true, controls: true } renderVideo(torrent.files[0], this.playerElement, options,(err, renderer) => { + this.renderer = renderer + if (err) return this.fallbackToHttp() - this.renderer = renderer if (!this.player.paused()) { const playPromise = this.player.play() if (playPromise !== undefined) return playPromise.then(done) @@ -406,7 +407,7 @@ class PeerTubePlugin extends Plugin { this.updateVideoFile(undefined, () => this.player.play()) } - private initializePlayer (options: PeertubePluginOptions) { + private initializePlayer () { if (this.autoplay === true) { this.updateVideoFile(undefined, () => this.player.play()) } else { -- cgit v1.2.3