diff options
Diffstat (limited to 'docs/tutorials.md')
-rw-r--r-- | docs/tutorials.md | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/docs/tutorials.md b/docs/tutorials.md index dfe67e9..2d39297 100644 --- a/docs/tutorials.md +++ b/docs/tutorials.md @@ -14,7 +14,6 @@ import WebTorrent from 'webtorrent' const client = new WebTorrent() const torrentId = 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent' const player = document.querySelector('video') -const scope = './' function download () { client.add(torrentId, torrent => { @@ -31,7 +30,7 @@ function download () { console.log('Ready to play!') }) } -navigator.serviceWorker.register('./sw.min.js', { scope }).then(reg => { +navigator.serviceWorker.register('./sw.min.js', { scope: './' }).then(reg => { const worker = reg.active || reg.waiting || reg.installing function checkState (worker) { return worker.state === 'activated' && client.createServer({ controller: reg }) && download() @@ -85,7 +84,6 @@ Code example: const client = new WebTorrent() const torrentId = 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent' const player = document.querySelector('video') -const scope = './' function download () { client.add(torrentId, torrent => { @@ -97,7 +95,7 @@ function download () { console.log('Ready to play!') }) } -navigator.serviceWorker.register('./sw.min.js', { scope }).then(reg => { +navigator.serviceWorker.register('./sw.min.js', { scope: './' }).then(reg => { const worker = reg.active || reg.waiting || reg.installing function checkState (worker) { return worker.state === 'activated' && client.createServer({ controller: reg }) && download() |