如何检测播放M3U8时在Safari iOS上加载在视频元素上的块错误(404)

发布于 2025-02-04 02:15:20 字数 1159 浏览 3 评论 0原文

播放

  1. 在那之后播放M3U8
  2. 列表,我停止通过剪切信号进行流式传输。 =>播放器停止但不要发射错误事件。 我无法捕获该错误要处理。

非常感谢您的评论,大家!

这是我的代码

<!DOCTYPE html>
<html>
<body>
<h1>The video autoplay attribute</h1>
<video id="VIDEO" width="320" height="240" controls autoplay playsInline/>
<script>
    const linkPlay = "https://sgn-fpt-001-livecdn-vt.vieon.vn/7ed4de9c6e5740688d95878c8bd5a766/1654246367317/dvr_event/60b822a4-ef69-4886-b942-351ab352779a/playlist.m3u8"
    function init() {
        const video = document.getElementById("VIDEO")
        console.log(video)
        console.log(video.canPlayType('application/vnd.apple.mpegurl'))
        video.src = linkPlay
        video.load()
        video.addEventListener('error', (e)=> {
            console.log('error', e)
        })
    }
    init();
</script>
</body>
</html>

这些是问题的图像

Reproduce

  1. Playing m3u8 playlist
  2. After that, I stop streaming by cut the signal.
    => Player stop but don't fire error event.
    I can't catch that error to handle.

Many thanks for the comments, everyone!

Here is my code

<!DOCTYPE html>
<html>
<body>
<h1>The video autoplay attribute</h1>
<video id="VIDEO" width="320" height="240" controls autoplay playsInline/>
<script>
    const linkPlay = "https://sgn-fpt-001-livecdn-vt.vieon.vn/7ed4de9c6e5740688d95878c8bd5a766/1654246367317/dvr_event/60b822a4-ef69-4886-b942-351ab352779a/playlist.m3u8"
    function init() {
        const video = document.getElementById("VIDEO")
        console.log(video)
        console.log(video.canPlayType('application/vnd.apple.mpegurl'))
        video.src = linkPlay
        video.load()
        video.addEventListener('error', (e)=> {
            console.log('error', e)
        })
    }
    init();
</script>
</body>
</html>

These are issue's image
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长途伴 2025-02-11 02:15:20

P/S:如果您需要调试,可以PM我,我将播放播放列表。
看待

P/s: If you need to debug, you can pm me and I will play the playlist.
Regard

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文