diff options
Diffstat (limited to 'client/src/assets/player/peertube-videojs-plugin.ts')
-rw-r--r-- | client/src/assets/player/peertube-videojs-plugin.ts | 7 |
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 { |