mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-14 08:26:16 -08:00
add mobile.hls.html
This commit is contained in:
1 parent
ac127bda77
commit
59f8e984e2
3 files changed
+65
-1
No files matched your search
File renamed without changes.
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Artplayer.js</title>
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
<meta name="keywords" content="artplayer, player, js, html5, video" />
|
||||
<meta name="description" content="ArtPlayer.js is a modern and full featured HTML5 video player" />
|
||||
<link rel="shortcut icon" href="./assets/img/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" href="./assets/css/normalize.css">
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.container {
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.artplayer-app {
|
||||
aspect-ratio: 16 / 9;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="artplayer-app"></div>
|
||||
</div>
|
||||
<script src="./assets/js/vconsole.min.js"></script>
|
||||
<script>var vConsole = new VConsole();</script>
|
||||
<script src="./uncompiled/artplayer/index.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/hls.js/8.0.0-beta.3/hls.min.js"></script>
|
||||
<script>
|
||||
Artplayer.DEBUG = true;
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
|
||||
customType: {
|
||||
m3u8: function playM3u8(video, url, art) {
|
||||
if (Hls.isSupported()) {
|
||||
const hls = new Hls();
|
||||
hls.loadSource(url);
|
||||
hls.attachMedia(video);
|
||||
art.hls = hls;
|
||||
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
||||
video.src = url;
|
||||
} else {
|
||||
art.notice.show = 'Unsupported playback format: m3u8';
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -249,7 +249,7 @@ class Artplayer extends (0, _emitterDefault.default) {
|
||||
return "development";
|
||||
}
|
||||
static get build() {
|
||||
return "2023-04-23 13:56:32";
|
||||
return "2023-04-23 21:38:22";
|
||||
}
|
||||
static get config() {
|
||||
return 0, _configDefault.default;
|
||||
|
||||
Reference in new issue
Block a user