aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/videos/embed-api.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-17 14:42:53 +0200
committerChocobozzz <me@florianbigard.com>2021-08-18 08:35:06 +0200
commit9df52d660feb722404be00a50f3c8a612bec1c15 (patch)
treedde52880fa012874d24c60f64eb596b0a789cc8b /client/src/standalone/videos/embed-api.ts
parentadb8809d43648ea0a64d6845bb39aa3bd0e005a6 (diff)
downloadPeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.gz
PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.zst
PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.zip
Migrate client to eslint
Diffstat (limited to 'client/src/standalone/videos/embed-api.ts')
-rw-r--r--client/src/standalone/videos/embed-api.ts19
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) {