46 lines
1.4 KiB
HTML
46 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Document</title>
|
|
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
|
|
|
|
<style>
|
|
#videoPlayer {
|
|
width: 400px;
|
|
height: 300px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<video id="videoPlayer" controls></video>
|
|
|
|
<script>
|
|
// Initialize Hls.js
|
|
if (Hls.isSupported()) {
|
|
var hls = new Hls();
|
|
hls.loadSource('eed0fa530f95531f9fac2a962dfbc7ea/video/index.m3u8');
|
|
hls.attachMedia(document.getElementById('videoPlayer'));
|
|
hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
|
document.getElementById('videoPlayer').play();
|
|
});
|
|
} else if (document.getElementById('videoPlayer').canPlayType('application/vnd.apple.mpegurl')) {
|
|
document.getElementById('videoPlayer').src = 'eed0fa530f95531f9fac2a962dfbc7ea/video/index.m3u8';
|
|
}
|
|
|
|
var isBought = false; // This should be set dynamically based on your application logic
|
|
|
|
var videoPlayer = document.getElementById('videoPlayer');
|
|
videoPlayer.addEventListener('ended', function () {
|
|
if (!isBought) {
|
|
alert('请购买观看全集。');
|
|
}
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html> |