diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-08 10:17:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-08 10:17:47 +0200 |
commit | ffacd78f21d4021b3c0f654ff63ef29ca7afcde3 (patch) | |
tree | e2cebf3ccb43b9c5ffcab68a838d6f25d3719c0a /client/src/standalone | |
parent | a13df19d578d3c5bf8babfc1864e45fbfda98a47 (diff) | |
download | PeerTube-ffacd78f21d4021b3c0f654ff63ef29ca7afcde3.tar.gz PeerTube-ffacd78f21d4021b3c0f654ff63ef29ca7afcde3.tar.zst PeerTube-ffacd78f21d4021b3c0f654ff63ef29ca7afcde3.zip |
Load embed api resolutions on init
Diffstat (limited to 'client/src/standalone')
-rw-r--r-- | client/src/standalone/videos/embed-api.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/client/src/standalone/videos/embed-api.ts b/client/src/standalone/videos/embed-api.ts index 94e39ec29..75174f2f8 100644 --- a/client/src/standalone/videos/embed-api.ts +++ b/client/src/standalone/videos/embed-api.ts | |||
@@ -140,12 +140,14 @@ export class PeerTubeEmbedApi { | |||
140 | }) | 140 | }) |
141 | 141 | ||
142 | // PeerTube specific capabilities | 142 | // PeerTube specific capabilities |
143 | |||
144 | if (this.isWebtorrent()) { | 143 | if (this.isWebtorrent()) { |
145 | this.embed.player.webtorrent().on('autoResolutionUpdate', () => this.loadWebTorrentResolutions()) | 144 | this.embed.player.webtorrent().on('autoResolutionUpdate', () => this.loadWebTorrentResolutions()) |
146 | this.embed.player.webtorrent().on('videoFileUpdate', () => this.loadWebTorrentResolutions()) | 145 | this.embed.player.webtorrent().on('videoFileUpdate', () => this.loadWebTorrentResolutions()) |
146 | |||
147 | this.loadWebTorrentResolutions() | ||
147 | } else { | 148 | } else { |
148 | this.embed.player.p2pMediaLoader().on('resolutionChange', () => this.loadP2PMediaLoaderResolutions()) | 149 | this.embed.player.p2pMediaLoader().on('resolutionChange', () => this.loadP2PMediaLoaderResolutions()) |
150 | this.embed.player.p2pMediaLoader().on('resolutionsLoaded', () => this.loadP2PMediaLoaderResolutions()) | ||
149 | } | 151 | } |
150 | 152 | ||
151 | this.embed.player.on('volumechange', () => { | 153 | this.embed.player.on('volumechange', () => { |
@@ -207,6 +209,6 @@ export class PeerTubeEmbedApi { | |||
207 | } | 209 | } |
208 | 210 | ||
209 | private isWebtorrent () { | 211 | private isWebtorrent () { |
210 | return this.embed.player.webtorrent | 212 | return !!this.embed.player.webtorrent |
211 | } | 213 | } |
212 | } | 214 | } |