]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/webtorrent/webtorrent-plugin.ts
wt-plugin: clearify err msg
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / webtorrent / webtorrent-plugin.ts
index 782c91cbdc7f3e2fc94e7a53c5edcaca852fa51a..287358ada93e5db5cf3f7c233c17791c24fba5e3 100644 (file)
@@ -139,6 +139,10 @@ class WebTorrentPlugin extends Plugin {
         : this.pickAverageVideoFile()
     }
 
+    if (videoFile === undefined) {
+      throw Error(`Can't update video file since videoFile is undefined.`)
+    }
+
     // Don't add the same video file once again
     if (this.currentVideoFile !== undefined && this.currentVideoFile.magnetUri === videoFile.magnetUri) {
       return
@@ -487,6 +491,7 @@ class WebTorrentPlugin extends Plugin {
       if (this.webtorrent.downloadSpeed !== 0) this.downloadSpeeds.push(this.webtorrent.downloadSpeed)
 
       return this.player.trigger('p2pInfo', {
+        source: 'webtorrent',
         http: {
           downloadSpeed: 0,
           uploadSpeed: 0,