X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fstandalone%2Fvideos%2Fembed-api.ts;h=94e39ec29c4c3e124442da6780c537917787428f;hb=dc48fdbe68e9dd3a3a6028181e61d8595d98e654;hp=a9263555d839e400b6e12292a3e000eff8eafff9;hpb=1151f5210c0e7665ec6714e73261f299e6fe757b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/standalone/videos/embed-api.ts b/client/src/standalone/videos/embed-api.ts index a9263555d..94e39ec29 100644 --- a/client/src/standalone/videos/embed-api.ts +++ b/client/src/standalone/videos/embed-api.ts @@ -26,7 +26,7 @@ export class PeerTubeEmbedApi { } private get element () { - return this.embed.videoElement + return this.embed.playerElement } private constructChannel () { @@ -50,6 +50,10 @@ export class PeerTubeEmbedApi { channel.bind('setPlaybackRate', (txn, playbackRate) => this.embed.player.playbackRate(playbackRate)) channel.bind('getPlaybackRate', (txn, params) => this.embed.player.playbackRate()) channel.bind('getPlaybackRates', (txn, params) => this.embed.player.options_.playbackRates) + + channel.bind('playNextVideo', (txn, params) => this.embed.playNextVideo()) + channel.bind('playPreviousVideo', (txn, params) => this.embed.playPreviousVideo()) + channel.bind('getCurrentPosition', (txn, params) => this.embed.getCurrentPosition()) this.channel = channel } @@ -108,7 +112,6 @@ export class PeerTubeEmbedApi { setInterval(() => { const position = this.element.currentTime const volume = this.element.volume - const duration = this.element.duration this.channel.notify({ method: 'playbackStatusUpdate',