mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-17 18:11:20 -08:00
update docs
This commit is contained in:
1 parent
e0b351831e
commit
824baca8b4
48 files changed
+165
-165
No files matched your search
@@ -63,13 +63,6 @@ var art = new Artplayer({
|
||||
hls.destroy();
|
||||
}
|
||||
|
||||
// When the player is destroyed, the decoder instance must also be destroyed
|
||||
art.on('destroy', () => {
|
||||
if (hls) {
|
||||
hls.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
hls = new Hls();
|
||||
hls.loadSource(url);
|
||||
hls.attachMedia(video);
|
||||
@@ -77,6 +70,13 @@ var art = new Artplayer({
|
||||
},
|
||||
});
|
||||
|
||||
// When the player is destroyed, the decoder instance must also be destroyed
|
||||
art.on('destroy', () => {
|
||||
if (hls) {
|
||||
hls.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
// Switch to a new video address
|
||||
art.url = '/assets/sample/video-new.m3u8';
|
||||
```
|
||||
|
||||
@@ -61,13 +61,6 @@ var art = new Artplayer({
|
||||
hls.destroy();
|
||||
}
|
||||
|
||||
// 播放器销毁时,也要销毁解码器实例
|
||||
art.on('destroy', () => {
|
||||
if (hls) {
|
||||
hls.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
hls = new Hls();
|
||||
hls.loadSource(url);
|
||||
hls.attachMedia(video);
|
||||
@@ -75,6 +68,13 @@ var art = new Artplayer({
|
||||
},
|
||||
});
|
||||
|
||||
// 播放器销毁时,也要销毁解码器实例
|
||||
art.on('destroy', () => {
|
||||
if (hls) {
|
||||
hls.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
// 切换新的视频地址
|
||||
art.url = '/assets/sample/video-new.m3u8';
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user