diff options
Diffstat (limited to 'client/src/standalone/videos/embed-api.ts')
-rw-r--r-- | client/src/standalone/videos/embed-api.ts | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/client/src/standalone/videos/embed-api.ts b/client/src/standalone/videos/embed-api.ts index 75174f2f8..b5c9da431 100644 --- a/client/src/standalone/videos/embed-api.ts +++ b/client/src/standalone/videos/embed-api.ts | |||
@@ -13,7 +13,8 @@ export class PeerTubeEmbedApi { | |||
13 | private isReady = false | 13 | private isReady = false |
14 | private resolutions: PeerTubeResolution[] = [] | 14 | private resolutions: PeerTubeResolution[] = [] |
15 | 15 | ||
16 | constructor (private embed: PeerTubeEmbed) { | 16 | constructor (private readonly embed: PeerTubeEmbed) { |
17 | |||
17 | } | 18 | } |
18 | 19 | ||
19 | initialize () { | 20 | initialize () { |
@@ -45,7 +46,7 @@ export class PeerTubeEmbedApi { | |||
45 | channel.bind('getResolutions', (txn, params) => this.resolutions) | 46 | channel.bind('getResolutions', (txn, params) => this.resolutions) |
46 | 47 | ||
47 | channel.bind('getCaptions', (txn, params) => this.getCaptions()) | 48 | channel.bind('getCaptions', (txn, params) => this.getCaptions()) |
48 | channel.bind('setCaption', (txn, id) => this.setCaption(id)), | 49 | channel.bind('setCaption', (txn, id) => this.setCaption(id)) |
49 | 50 | ||
50 | channel.bind('setPlaybackRate', (txn, playbackRate) => this.embed.player.playbackRate(playbackRate)) | 51 | channel.bind('setPlaybackRate', (txn, playbackRate) => this.embed.player.playbackRate(playbackRate)) |
51 | channel.bind('getPlaybackRate', (txn, params) => this.embed.player.playbackRate()) | 52 | channel.bind('getPlaybackRate', (txn, params) => this.embed.player.playbackRate()) |
@@ -79,14 +80,12 @@ export class PeerTubeEmbedApi { | |||
79 | } | 80 | } |
80 | 81 | ||
81 | private getCaptions (): PeerTubeTextTrack[] { | 82 | private getCaptions (): PeerTubeTextTrack[] { |
82 | return this.embed.player.textTracks().tracks_.map(t => { | 83 | return this.embed.player.textTracks().tracks_.map(t => ({ |
83 | return { | 84 | id: t.id, |
84 | id: t.id, | 85 | src: t.src, |
85 | src: t.src, | 86 | label: t.label, |
86 | label: t.label, | 87 | mode: t.mode |
87 | mode: t.mode as any | 88 | })) |
88 | } | ||
89 | }) | ||
90 | } | 89 | } |
91 | 90 | ||
92 | private setCaption (id: string) { | 91 | private setCaption (id: string) { |