aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/player/player.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/standalone/player/player.ts')
-rw-r--r--client/src/standalone/player/player.ts17
1 files changed, 16 insertions, 1 deletions
diff --git a/client/src/standalone/player/player.ts b/client/src/standalone/player/player.ts
index 71c412950..119f5e035 100644
--- a/client/src/standalone/player/player.ts
+++ b/client/src/standalone/player/player.ts
@@ -1,6 +1,6 @@
1import * as Channel from 'jschannel' 1import * as Channel from 'jschannel'
2import { EventHandler, PeerTubeResolution, PeerTubeTextTrack, PlayerEventType } from './definitions'
2import { EventRegistrar } from './events' 3import { EventRegistrar } from './events'
3import { EventHandler, PlayerEventType, PeerTubeResolution } from './definitions'
4 4
5const PASSTHROUGH_EVENTS = [ 5const PASSTHROUGH_EVENTS = [
6 'pause', 6 'pause',
@@ -105,6 +105,21 @@ export class PeerTubePlayer {
105 } 105 }
106 106
107 /** 107 /**
108 * Tell the embed to change the current caption
109 * @param value Caption id
110 */
111 async setCaption (value: string) {
112 await this.sendMessage('setCaption', value)
113 }
114
115 /**
116 * Get video captions
117 */
118 async getCaptions (): Promise<PeerTubeTextTrack[]> {
119 return this.sendMessage<void, PeerTubeTextTrack[]>('getCaptions')
120 }
121
122 /**
108 * Tell the embed to seek to a specific position (in seconds) 123 * Tell the embed to seek to a specific position (in seconds)
109 * @param seconds 124 * @param seconds
110 */ 125 */