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
@@ -9,14 +9,12 @@
|
||||
```js{21-24,28}
|
||||
function playM3u8(video, url, art) {
|
||||
if (Hls.isSupported()) {
|
||||
if (art.hls) art.hls.destroy();
|
||||
const hls = new Hls();
|
||||
hls.loadSource(url);
|
||||
hls.attachMedia(video);
|
||||
|
||||
// optional
|
||||
art.hls = hls;
|
||||
art.once('url', () => hls.destroy());
|
||||
art.once('destroy', () => hls.destroy());
|
||||
art.on('destroy', () => hls.destroy());
|
||||
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
||||
video.src = url;
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user