]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/standalone/videos/embed-api.ts
Fix webpack config
[github/Chocobozzz/PeerTube.git] / client / src / standalone / videos / embed-api.ts
index 94e39ec29c4c3e124442da6780c537917787428f..75174f2f8ef2a6eca1362ab52db7d3e7b8234001 100644 (file)
@@ -140,12 +140,14 @@ export class PeerTubeEmbedApi {
     })
 
     // PeerTube specific capabilities
-
     if (this.isWebtorrent()) {
       this.embed.player.webtorrent().on('autoResolutionUpdate', () => this.loadWebTorrentResolutions())
       this.embed.player.webtorrent().on('videoFileUpdate', () => this.loadWebTorrentResolutions())
+
+      this.loadWebTorrentResolutions()
     } else {
       this.embed.player.p2pMediaLoader().on('resolutionChange', () => this.loadP2PMediaLoaderResolutions())
+      this.embed.player.p2pMediaLoader().on('resolutionsLoaded', () => this.loadP2PMediaLoaderResolutions())
     }
 
     this.embed.player.on('volumechange', () => {
@@ -207,6 +209,6 @@ export class PeerTubeEmbedApi {
   }
 
   private isWebtorrent () {
-    return this.embed.player.webtorrent
+    return !!this.embed.player.webtorrent
   }
 }