diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-30 10:54:14 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-07-30 10:54:14 +0200 |
commit | 85394ba22a07bde1dfccebf3f591a5d6dbe9df56 (patch) | |
tree | 629ca49244824b7ec922628af009034edce2ff6a /client/src/assets/player/webtorrent/webtorrent-plugin.ts | |
parent | df9a1a13654a1ca5229e8e940c25bae94af1717b (diff) | |
download | PeerTube-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.ts | 9 |
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 => { |