diff options
Diffstat (limited to 'client/src/standalone/player/player.ts')
-rw-r--r-- | client/src/standalone/player/player.ts | 17 |
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 @@ | |||
1 | import * as Channel from 'jschannel' | 1 | import * as Channel from 'jschannel' |
2 | import { EventHandler, PeerTubeResolution, PeerTubeTextTrack, PlayerEventType } from './definitions' | ||
2 | import { EventRegistrar } from './events' | 3 | import { EventRegistrar } from './events' |
3 | import { EventHandler, PlayerEventType, PeerTubeResolution } from './definitions' | ||
4 | 4 | ||
5 | const PASSTHROUGH_EVENTS = [ | 5 | const 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 | */ |