mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-31 04:31:20 -08:00
update docs
This commit is contained in:
1 parent
7c8a3c2c7d
commit
3b57470957
14 files changed
+29
-46
No files matched your search
@@ -8,6 +8,7 @@
|
||||
|
||||
```js{21-24,28}
|
||||
function playTorrent(video, url, art) {
|
||||
if (art.torrent) art.torrent.destroy();
|
||||
const torrent = new WebTorrent();
|
||||
torrent.add(url, function (torrent) {
|
||||
var file = torrent.files[0];
|
||||
@@ -15,11 +16,8 @@ function playTorrent(video, url, art) {
|
||||
autoplay: art.option.autoplay,
|
||||
});
|
||||
});
|
||||
|
||||
// optional
|
||||
art.torrent = torrent;
|
||||
art.once('url', () => torrent.destroy());
|
||||
art.once('destroy', () => torrent.destroy());
|
||||
art.on('destroy', () => torrent.destroy());
|
||||
}
|
||||
|
||||
var art = new Artplayer({
|
||||
|
||||
Reference in new issue
Block a user