Update webtorrent.js

This commit is contained in:
Harvey Zack committed 2024-05-31 10:20:01 +08:00
1 parent a8151ba4fb
commit 495083aba1
1 file changed
+1 -2
+1 -2
View File
@@ -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) => {