aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/webtorrent/webtorrent-plugin.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-30 10:54:14 +0200
committerChocobozzz <me@florianbigard.com>2019-07-30 10:54:14 +0200
commit85394ba22a07bde1dfccebf3f591a5d6dbe9df56 (patch)
tree629ca49244824b7ec922628af009034edce2ff6a /client/src/assets/player/webtorrent/webtorrent-plugin.ts
parentdf9a1a13654a1ca5229e8e940c25bae94af1717b (diff)
downloadPeerTube-85394ba22a07bde1dfccebf3f591a5d6dbe9df56.tar.gz
PeerTube-85394ba22a07bde1dfccebf3f591a5d6dbe9df56.tar.zst
PeerTube-85394ba22a07bde1dfccebf3f591a5d6dbe9df56.zip
Fix webtorrent player
Diffstat (limited to 'client/src/assets/player/webtorrent/webtorrent-plugin.ts')
-rw-r--r--client/src/assets/player/webtorrent/webtorrent-plugin.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts
index eee3d4db9..95f52dfe1 100644
--- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts
+++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts
@@ -234,9 +234,12 @@ class WebTorrentPlugin extends Plugin {
234 234
235 const oldTorrent = this.torrent 235 const oldTorrent = this.torrent
236 const torrentOptions = { 236 const torrentOptions = {
237 store: (chunkLength: number, storeOpts: any) => new CacheChunkStore(new PeertubeChunkStore(chunkLength, storeOpts), { 237 // Don't use arrow function: it breaks webtorrent (that uses `new` keyword)
238 max: 100 238 store: function (chunkLength: number, storeOpts: any) {
239 }) 239 return new CacheChunkStore(new PeertubeChunkStore(chunkLength, storeOpts), {
240 max: 100
241 })
242 }
240 } 243 }
241 244
242 this.torrent = this.webtorrent.add(magnetOrTorrentUrl, torrentOptions, torrent => { 245 this.torrent = this.webtorrent.add(magnetOrTorrentUrl, torrentOptions, torrent => {