From 9054a8b6e522dd8d46260dca85e9de94a2d806cf Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 5 Aug 2020 14:16:39 +0200 Subject: Handle playlist methods in embed api --- client/src/standalone/player/player.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'client/src/standalone/player/player.ts') diff --git a/client/src/standalone/player/player.ts b/client/src/standalone/player/player.ts index 119f5e035..9776fda12 100644 --- a/client/src/standalone/player/player.ts +++ b/client/src/standalone/player/player.ts @@ -170,6 +170,27 @@ export class PeerTubePlayer { await this.sendMessage('setPlaybackRate', rate) } + /** + * Play next video in playlist + */ + async playNextVideo () { + await this.sendMessage('playNextVideo') + } + + /** + * Play previous video in playlist + */ + async playPreviousVideo () { + await this.sendMessage('playPreviousVideo') + } + + /** + * Get video position currently played (starts from 1) + */ + async getCurrentPosition () { + return this.sendMessage('getCurrentPosition') + } + private constructChannel () { this.channel = Channel.build({ window: this.embedElement.contentWindow, -- cgit v1.2.3