diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-23 15:01:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-23 15:02:48 +0100 |
commit | 531ab5b6279707b2d0d01d3153e62c4bdfca8480 (patch) | |
tree | a947010d71959fc39fe53f9d1719f0f0c55f60f4 | |
parent | 8c4890cbfe3b5c742ed8756d7a0fd2f533534c6a (diff) | |
download | PeerTube-531ab5b6279707b2d0d01d3153e62c4bdfca8480.tar.gz PeerTube-531ab5b6279707b2d0d01d3153e62c4bdfca8480.tar.zst PeerTube-531ab5b6279707b2d0d01d3153e62c4bdfca8480.zip |
Don't play video if user paused it during loading
-rw-r--r-- | client/src/assets/player/peertube-videojs-plugin.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index 0a7651a81..5ccfdce36 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts | |||
@@ -56,7 +56,8 @@ class ResolutionMenuItem extends MenuItem { | |||
56 | } | 56 | } |
57 | 57 | ||
58 | handleClick (event) { | 58 | handleClick (event) { |
59 | MenuItem.prototype.handleClick.call(this, event) | 59 | super.handleClick(event) |
60 | |||
60 | this.player_.peertube().updateResolution(this.options_.id) | 61 | this.player_.peertube().updateResolution(this.options_.id) |
61 | } | 62 | } |
62 | } | 63 | } |
@@ -279,14 +280,14 @@ class PeerTubePlugin extends Plugin { | |||
279 | if (err) return this.handleError(err) | 280 | if (err) return this.handleError(err) |
280 | 281 | ||
281 | this.renderer = renderer | 282 | this.renderer = renderer |
282 | this.player.play().then(done) | 283 | if (!this.player.paused()) this.player.play().then(done) |
283 | }) | 284 | }) |
284 | }) | 285 | }) |
285 | 286 | ||
286 | this.torrent.on('error', err => this.handleError(err)) | 287 | this.torrent.on('error', err => this.handleError(err)) |
287 | this.torrent.on('warning', (err: any) => { | 288 | this.torrent.on('warning', (err: any) => { |
288 | // We don't support HTTP tracker but we don't care -> we use the web socket tracker | 289 | // We don't support HTTP tracker but we don't care -> we use the web socket tracker |
289 | if (err.message.indexOf('Unsupported tracker protocol: http') !== -1) return | 290 | if (err.message.indexOf('Unsupported tracker protocol') !== -1) return |
290 | // Users don't care about issues with WebRTC, but developers do so log it in the console | 291 | // Users don't care about issues with WebRTC, but developers do so log it in the console |
291 | if (err.message.indexOf('Ice connection failed') !== -1) { | 292 | if (err.message.indexOf('Ice connection failed') !== -1) { |
292 | console.error(err) | 293 | console.error(err) |
@@ -304,6 +305,9 @@ class PeerTubePlugin extends Plugin { | |||
304 | const currentTime = this.player.currentTime() | 305 | const currentTime = this.player.currentTime() |
305 | const isPaused = this.player.paused() | 306 | const isPaused = this.player.paused() |
306 | 307 | ||
308 | // Remove poster to have black background | ||
309 | this.playerElement.poster = '' | ||
310 | |||
307 | // Hide bigPlayButton | 311 | // Hide bigPlayButton |
308 | if (!isPaused) { | 312 | if (!isPaused) { |
309 | this.player.bigPlayButton.hide() | 313 | this.player.bigPlayButton.hide() |