mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
64 lines
2.1 KiB
HTML
64 lines
2.1 KiB
HTML
<!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> |