mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
Update webtorrent.js
This commit is contained in:
1 parent
a8151ba4fb
commit
495083aba1
1 file changed
+1
-2
@@ -6,8 +6,7 @@ async function playTorrent(video, url, art) {
|
||||
if (art.torrent) art.torrent.destroy();
|
||||
art.torrent = new WebTorrent();
|
||||
|
||||
const registration = await navigator.serviceWorker.register('/webtorrent.sw.min.js', { scope: '/' });
|
||||
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
await navigator.serviceWorker.register('/webtorrent.sw.min.js');
|
||||
art.torrent.loadWorker(navigator.serviceWorker.controller);
|
||||
|
||||
art.torrent.add(url, (torrent) => {
|
||||
|
||||
Reference in new issue
Block a user