aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/player/player.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-05 14:16:39 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-07 08:58:29 +0200
commit9054a8b6e522dd8d46260dca85e9de94a2d806cf (patch)
tree5699e0c2853c17cbaef037eec4cb48cfbf0ec06d /client/src/standalone/player/player.ts
parent2a71d286cec31964e0b70b5a7c53bfad401af554 (diff)
downloadPeerTube-9054a8b6e522dd8d46260dca85e9de94a2d806cf.tar.gz
PeerTube-9054a8b6e522dd8d46260dca85e9de94a2d806cf.tar.zst
PeerTube-9054a8b6e522dd8d46260dca85e9de94a2d806cf.zip
Handle playlist methods in embed api
Diffstat (limited to 'client/src/standalone/player/player.ts')
-rw-r--r--client/src/standalone/player/player.ts21
1 files changed, 21 insertions, 0 deletions
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 {
170 await this.sendMessage('setPlaybackRate', rate) 170 await this.sendMessage('setPlaybackRate', rate)
171 } 171 }
172 172
173 /**
174 * Play next video in playlist
175 */
176 async playNextVideo () {
177 await this.sendMessage('playNextVideo')
178 }
179
180 /**
181 * Play previous video in playlist
182 */
183 async playPreviousVideo () {
184 await this.sendMessage('playPreviousVideo')
185 }
186
187 /**
188 * Get video position currently played (starts from 1)
189 */
190 async getCurrentPosition () {
191 return this.sendMessage<void, number>('getCurrentPosition')
192 }
193
173 private constructChannel () { 194 private constructChannel () {
174 this.channel = Channel.build({ 195 this.channel = Channel.build({
175 window: this.embedElement.contentWindow, 196 window: this.embedElement.contentWindow,