<legend id='0PjTY'><style id='0PjTY'><dir id='0PjTY'><q id='0PjTY'></q></dir></style></legend>
    • <bdo id='0PjTY'></bdo><ul id='0PjTY'></ul>

    <small id='0PjTY'></small><noframes id='0PjTY'>

    1. <i id='0PjTY'><tr id='0PjTY'><dt id='0PjTY'><q id='0PjTY'><span id='0PjTY'><b id='0PjTY'><form id='0PjTY'><ins id='0PjTY'></ins><ul id='0PjTY'></ul><sub id='0PjTY'></sub></form><legend id='0PjTY'></legend><bdo id='0PjTY'><pre id='0PjTY'><center id='0PjTY'></center></pre></bdo></b><th id='0PjTY'></th></span></q></dt></tr></i><div id='0PjTY'><tfoot id='0PjTY'></tfoot><dl id='0PjTY'><fieldset id='0PjTY'></fieldset></dl></div>
    2. <tfoot id='0PjTY'></tfoot>

        多次播放后 iOS UIWebView 中 HTML5 视频的 MEDIA_ERR_DECODE

        时间:2023-10-22

          <i id='IdHbm'><tr id='IdHbm'><dt id='IdHbm'><q id='IdHbm'><span id='IdHbm'><b id='IdHbm'><form id='IdHbm'><ins id='IdHbm'></ins><ul id='IdHbm'></ul><sub id='IdHbm'></sub></form><legend id='IdHbm'></legend><bdo id='IdHbm'><pre id='IdHbm'><center id='IdHbm'></center></pre></bdo></b><th id='IdHbm'></th></span></q></dt></tr></i><div id='IdHbm'><tfoot id='IdHbm'></tfoot><dl id='IdHbm'><fieldset id='IdHbm'></fieldset></dl></div>
          <tfoot id='IdHbm'></tfoot>
        • <legend id='IdHbm'><style id='IdHbm'><dir id='IdHbm'><q id='IdHbm'></q></dir></style></legend>

          1. <small id='IdHbm'></small><noframes id='IdHbm'>

              <bdo id='IdHbm'></bdo><ul id='IdHbm'></ul>

                    <tbody id='IdHbm'></tbody>
                  本文介绍了多次播放后 iOS UIWebView 中 HTML5 视频的 MEDIA_ERR_DECODE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 iOS 的 UIWebView 中的 HTML5 视频控件中播放大约 20 个短视频剪辑 (mp4) 后,后续剪辑因 MEDIA_ERR_DECODE 而失败.问题是,我知道这些视频很好,因为它们以前播放过,有时甚至在同一会话期间播放.

                  After playing around 20 short video clips (mp4's) in an HTML5 video control in a UIWebView in iOS, subsequent clips are failing with a MEDIA_ERR_DECODE. The thing is, is that I know the videos are fine, because they were previously played, sometimes even during the same session.

                  此外,如果您等待足够长的时间来请求新的视频剪辑,它通常会重新开始工作.

                  Furthermore, if you wait long enough to request a new video clip, it will usually start working again.

                  我也知道这不是服务器,因为我可以在台式计算机上的 chrome 上执行完全相同的操作,并且它总是可以工作.

                  I also know it's not the server because I can do the exact same operation on chrome on my desktop computer and it always works.

                  根据我的故障排除,该错误似乎出在 iOS 本身.

                  Based on my troubleshooting, it seems like the bug is in iOS itself.

                  1. 有人对解决这个问题有任何想法吗?
                  2. 有什么方法可以获取有关 iOS 中此类媒体解码错误的更多信息?我尝试使用 Safari 的开发工具来监听 http 请求,但我不能让它记录超过几秒钟,然后它就会遇到内存不足错误并杀死应用程序.

                  更新:在 iOS 模拟器中运行时也可以正常工作.看来问题只出现在 iPad 本身上

                  推荐答案

                  经过与 Apple Support 的讨论,问题已得到解决.问题与硬件 H264 解码器有关.基本上,我从来没有通过释放视频资源(我认为javascript会自己做)来从硬件解码器缓冲区中删除视频.

                  After a discussion with Apple Support, the problem has been fixed. The problem has to do with the hardware H264 decoder. Basically, I was never removing the videos from the hardware decoder buffer by never releasing the video resources (which I thought javascript would do itself).

                  所以我是这样设置源的:

                  So I was setting the source like this:

                  $(vid).src = "some source file";
                  $(vid).play();
                  ... some other stuff happens ...
                  $(vid).remove();
                  

                  这样做永远不会从解码器缓冲区中删除视频,这意味着最终它无法解码更多视频.

                  Doing it this way never removed the video from the decoder buffer, which meant that eventually it not be able to decode any more videos.

                  要解决此问题,您必须通过以下方式从 DOM 中删除视频:

                  To fix this, this is how you must remove the video from the DOM:

                  $(vid).src = "some source file";
                  $(vid).play();
                  ... some other stuff happens ...
                  $(vid).remove();
                  $(vid).src = "";
                  $(vid).load();
                  

                  现在我意识到这没有多大意义,因为在调用 .remove() 之后,我会假设控件已从 DOM 中删除,并且任何垃圾回收都会其余的自动完成.但是,它不是那样工作的.我希望这对其他人有所帮助.

                  Now I realize that this doesn't make a ton of sense because after .remove() is called, I would have assumed that the control has been removed from the DOM and any garbage collection would do the rest automatically. However, it doesn't work like that. I hope this helps other people.

                  这篇关于多次播放后 iOS UIWebView 中 HTML5 视频的 MEDIA_ERR_DECODE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 iPhone 上的 UIWebview 中清除后退列表? 下一篇:iPhone UIWebView PDF 页面跳转

                  相关文章

                    <bdo id='SWLyv'></bdo><ul id='SWLyv'></ul>

                    <small id='SWLyv'></small><noframes id='SWLyv'>

                      <i id='SWLyv'><tr id='SWLyv'><dt id='SWLyv'><q id='SWLyv'><span id='SWLyv'><b id='SWLyv'><form id='SWLyv'><ins id='SWLyv'></ins><ul id='SWLyv'></ul><sub id='SWLyv'></sub></form><legend id='SWLyv'></legend><bdo id='SWLyv'><pre id='SWLyv'><center id='SWLyv'></center></pre></bdo></b><th id='SWLyv'></th></span></q></dt></tr></i><div id='SWLyv'><tfoot id='SWLyv'></tfoot><dl id='SWLyv'><fieldset id='SWLyv'></fieldset></dl></div>
                      <tfoot id='SWLyv'></tfoot>

                    1. <legend id='SWLyv'><style id='SWLyv'><dir id='SWLyv'><q id='SWLyv'></q></dir></style></legend>