HTML 视频播放一段时间后返回 MEDIA_ERR_SRC_NOT_SUPPORTED 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29822573/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
HTML video returns MEDIA_ERR_SRC_NOT_SUPPORTED error after playing for a while
提问by Question Mcquestioner
I am trying to play a video streamed by a third party using the HTML5 video player in Chrome Mobile, the problem I am facing is that the video can play for some time while it's minimized and after a while it decides to quit and return a MEDIA_ERR_SRC_NOT_SUPPORTED- audio/video not supported error; the problem happens much faster when I switch from minimised to maximised then back to minimised over and over again. It also seems to happen faster if I continuously tap on the video itself, I have also hidden the default controls and use my own custom ones.
我正在尝试使用 Chrome Mobile 中的 HTML5 视频播放器播放由第三方流式传输的视频,我面临的问题是视频可以在最小化时播放一段时间,一段时间后它决定退出并返回MEDIA_ERR_SRC_NOT_SUPPORTED- 音频/视频不支持错误;当我从最小化到最大化然后一遍又一遍地切换到最小化时,问题发生得更快。如果我不断点击视频本身,它似乎也发生得更快,我还隐藏了默认控件并使用了我自己的自定义控件。
What could be causing this issue ? I try the same thing in Safari with the QuickTime player and the video feed does no die
什么可能导致这个问题?我用 QuickTime 播放器在 Safari 中尝试了同样的事情,视频源没有死
EDIT: Did some more digging around and found this: Android HLS video mime type
编辑:做了一些更多的挖掘,发现了这个: Android HLS video mime type
I receive a playlist m3u8 file but my request link does not have m3u8 in it whatsoever but should the video even be playing if the m3u8 keyword isn't there ? I am also testing this on an android 4.4.4
我收到一个播放列表 m3u8 文件,但我的请求链接中没有 m3u8 但如果没有 m3u8 关键字,视频是否应该播放?我也在 android 4.4.4 上测试这个
回答by Dunc
Specifying the correct MIME type is worth a try. However, there's one other thing that caught me out (with iOS anyway): check that the server hosting the video supports 206 Partial Content
requests correctly. I posted about debugging this issue here.
指定正确的 MIME 类型值得一试。但是,还有另一件事让我感到困惑(无论如何使用 iOS):检查托管视频的服务器206 Partial Content
是否正确支持请求。我在此处发布了有关调试此问题的信息。
回答by GOLOC
If your using FireFox and getting the SRC not supported, I went threw the codes on some of the players at sites I like to view, I found that the Adobe Flash Player will solve the Problem, FF uses the VLC plugins, but with the current updates on FF with the VLC on HTLM5 players you might get a SRC error code, you need the Adobe Flash Player.
如果您使用 FireFox 并且不支持 SRC,我将代码扔到我喜欢查看的网站上的一些播放器上,我发现 Adobe Flash Player 将解决问题,FF 使用 VLC 插件,但与当前使用 HTLM5 播放器上的 VLC 在 FF 上更新您可能会收到 SRC 错误代码,您需要 Adobe Flash Player。
回答by Thealon
I have searched your error code on internet and i have found this:
我在互联网上搜索了你的错误代码,我发现了这个:
MEDIA_ERR_SRC_NOT_SUPPORTED (4) The media resource specified by src was not usable. MEDIA_ERR_SRC_NOT_SUPPORTED (5) The encrypted media stream could not be played. This is because of one of the following conditions: A key was not provided and a onmsneedkey handler was not provided The provided key could not be applied. Decryption is not supported for this media data.
MEDIA_ERR_SRC_NOT_SUPPORTED (4) src 指定的媒体资源不可用。MEDIA_ERR_SRC_NOT_SUPPORTED (5) 无法播放加密媒体流。这是因为以下条件之一: 未提供密钥且未提供 onmsneedkey 处理程序 无法应用提供的密钥。此媒体数据不支持解密。
So I would say you initialize src wrong.
所以我会说你初始化 src 错误。