换其他的播放器就有声音
流媒体
[](http://[2409:8087:5e00:24::1e]:6060/000000001000/5000000004000014694/1.m3u8)
[视频信息]
视频编码: H264 -
输入格式: H264(24 bits)
输入尺寸: 1920 × 1080(1.78:1)
输出格式: YV12(12 bits)
输出尺寸: 1920 × 1080(1.78:1)
帧率: 25
BitRate: 未知
[音频信息]
音频编码: MPEG Audio(0x50)
采样率: 48000 -> 48000 Hz
位率: 0 -> 16 位
声道数: 2 -> 2 声道
Bitrate: 128 kbps
<!-- 添加一个模板,在屏幕的右下方居中的位置 -->
<div class="template-container"></div>
<!-- 引入HLS.js库,支持HLS流媒体播放 -->
<script src="hls.js"></script>
<!-- 引入ArtPlayer库,用于视频播放 -->
<script src="artplayer.js"></script>
<!-- 引入自定义JavaScript文件,用于应用逻辑 -->
<script src="script.js"></script>
</body>
</html>
art = new Artplayer({
container: '.artplayer-app',
url: url,
isLive: true, // 启用直播模式
hotkey: false, // 关闭快捷键功能
customType: {
'm3u8': function(video, url) {
fetch(url, { redirect: 'follow' })
.then(response => {
if (response.redirected) {
const redirectUrl = response.url;
console.log('Redirected to:', redirectUrl);
if (Hls.isSupported()) {
const hls = new Hls();
hls.loadSource(redirectUrl);
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED, function() {
video.play();
});
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = redirectUrl;
video.addEventListener('loadedmetadata', function() {
video.play();
});
}
} else {
if (Hls.isSupported()) {
const hls = new Hls();
hls.loadSource(url);
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED, function() {
video.play();
});
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = url;
video.addEventListener('loadedmetadata', function() {
video.play();
});
}
}
})
.catch(error => {
console.error('Error:', error);
});
}
}
});