简体   繁体   English

html5视频性能问题Internet Explorer

[英]html5 video performance issue Internet Explorer

I'm having some problems with html5 video in Internet Explorer 10 (and probable 9 and 11 as well). 我在Internet Explorer 10(以及可能的9和11)中使用html5视频时遇到了一些问题。

The problem is that I'm playing multiple video's at the same time. 问题是我要同时播放多个视频。 In Firefox and Chrome there's no problem. 在Firefox和Chrome中没有问题。 In IE at first also no problem. 首先在IE中也没问题。 The problem comes when I start scrolling. 当我开始滚动时就会出现问题。 Then the video's get scrambled up and the timing isn't good anymore. 然后视频变得混乱,时机变得不好了。

Are there ways to improve the performance of IE? 有什么方法可以改善IE的性能吗?

Thanks! 谢谢!

I doubt that you can really do anything here. 我怀疑您真的可以在这里做任何事情。 The more videos you add the slower it will be - sooner or later in Firefox and Chrome as well. 您添加的视频越多,它就会变得越慢-Firefox和Chrome中的迟早也是如此。

You will likely reach better performance by using the old-fashioned <object> tag for embedding Windows Media files, however that is outdated and will only work in IE properly. 通过使用老式的<object>标记嵌入Windows Media文件,可能会获得更好的性能,但是这已经过时了,并且只能在IE中正常工作。

What you could do is to check via JavaScript which videos are actually "visible" for the user (I assume that a user does not see every video as soon as he starts scrolling, he might see two/three of them but not more) and pause/remove the videos that are currently not visible. 您可以做的是通过JavaScript检查对于用户而言哪些视频实际上是“可见的”(我假设用户开始滚动后并没有看到每个视频,他可能会看到其中的两个/三个,但看不到更多),并且暂停/删除当前不可见的视频。 You can dynamically include them later on once the user scrolls back. 用户回滚后,您可以稍后动态包含它们。 This will certainly improve performance on all browsers. 当然,这将提高所有浏览器的性能。

EDIT 编辑

So you don't need any sound. 因此,您不需要任何声音。 GIFs are even more outdated, but hey, they even work on mobile devices. GIF甚至已经过时,但是,它们甚至可以在移动设备上运行。

Probably Silverlight is an option, there's still the Expression Encoder that will convert the video and give you a decent default player: 可能是Silverlight是一个选项,仍然有Expression Encoder可以转换视频并为您提供不错的默认播放器:

http://www.microsoft.com/en-US/download/details.aspx?id=18974 http://www.microsoft.com/en-US/download/details.aspx?id=18974

Maybe worth a try, at least it should make proper use of hardware acceleration. 也许值得一试,至少应该正确使用硬件加速。 But also outdated and will not work on mobile devices. 但也已经过时,将无法在移动设备上运行。

Another idea: always use the "Simple" encoding profile and a low resolution/frame rate. 另一个想法:始终使用“简单”编码配置文件和低分辨率/帧速率。 This will harm quality, but will still be much better than GIFs and takes much less CPU power on decoding. 这将损害质量,但仍将比GIF好得多,并且解码所需的CPU能力要少得多。 Depending on your encoding tool you will be able to configure this for H.264 and VC-1 video codec. 根据您的编码工具,您将能够为H.264和VC-1视频编解码器进行配置。 Give it a try. 试试看。

For IE 10 or less i've created a different page with animated gif. 对于IE 10或更低版本,我创建了带有动画gif的其他页面。 IE11 and other browsers have better performance with html5 video. IE11和其他浏览器的html5视频具有更好的性能。

Thanks a lot Microsoft, took me a couple of hours to debug this! 非常感谢Microsoft,我花了几个小时来调试它!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM