mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-10 21:06:15 -08:00
Update 7.html
This commit is contained in:
1 parent
84c9b539c3
commit
e0d2ffe0bf
1 file changed
+14
-4
+14
-4
@@ -38,19 +38,29 @@
|
||||
<script src="../uncompiled/artplayer.js"></script>
|
||||
<script>
|
||||
var vConsole = new VConsole();
|
||||
var whitelist = [new URL(window.location.href).searchParams.get('whitelist') || ''] || [];
|
||||
var art = new Artplayer({
|
||||
var whitelist = new URL(window.location.href).searchParams.get('whitelist');
|
||||
|
||||
var option = {
|
||||
container: '.artplayer-app',
|
||||
whitelist: whitelist,
|
||||
url: 'https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8',
|
||||
customType: {
|
||||
m3u8: function(video, url) {
|
||||
console.log('------hls开始');
|
||||
console.log('video', video);
|
||||
console.log('url', url);
|
||||
var hls = new Hls();
|
||||
hls.loadSource(url);
|
||||
hls.attachMedia(video);
|
||||
console.log('------hls结束');
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (whitelist) {
|
||||
option.whitelist = [whitelist]
|
||||
}
|
||||
|
||||
var art = new Artplayer(option);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in new issue
Block a user