mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Correctly catch play promise
This commit is contained in:
@@ -44,7 +44,15 @@ export class PeerTubeEmbedApi {
|
|||||||
|
|
||||||
channel.bind('setVideoPassword', (txn, value) => this.embed.setVideoPasswordByAPI(value))
|
channel.bind('setVideoPassword', (txn, value) => this.embed.setVideoPasswordByAPI(value))
|
||||||
|
|
||||||
channel.bind('play', (txn, params) => this.player.play())
|
channel.bind('play', (txn, params) => {
|
||||||
|
const p = this.player.play()
|
||||||
|
if (p) return
|
||||||
|
|
||||||
|
p.catch((err: Error) => {
|
||||||
|
console.error('Cannot play the video', err)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
channel.bind('pause', (txn, params) => this.player.pause())
|
channel.bind('pause', (txn, params) => this.player.pause())
|
||||||
channel.bind('seek', (txn, time) => this.player.currentTime(time))
|
channel.bind('seek', (txn, time) => this.player.currentTime(time))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user