FancyBox + MediaElement 播放器 + IE
尝试将 mediaelement.js 播放器合并到灯箱中 (fancybox.net)。
播放器在没有 FancyBox 的 IE 中工作。 FancyBox 在 IE 中使用常规文本内容。 但是播放器 + fancybox 一起在 IE 中不起作用(完美地工作 在所有其他浏览器中)。
只是测试页面上的播放器: http://ways-means.channeltree.com/index3.html
测试页面上灯箱内的播放器:http://ways-means.channeltree.com /index4.html
还尝试通过 iframe 拉入内容(与上面相同的测试域,但使用index5.html)
一整天都在绞尽脑汁,它可能是我错过的一些小/愚蠢的东西,但不确定是什么。
如有任何帮助,我们将不胜感激 - 谢谢!
Trying to incorporate the mediaelement.js player into a lightbox (fancybox.net).
Player works in IE without FancyBox.
FancyBox works in IE with regular text content.
But The player + fancybox together doesn't work in IE (works perfectly
in all other browsers).
Just the player on a test page: http://ways-means.channeltree.com/index3.html
Player within lightbox on a test page: http://ways-means.channeltree.com/index4.html
Also tried pulling the content in via an iframe (same test domain as above, but with index5.html)
Been racking my head all day, and its possibly something small/stupid that I'm missing, but not sure what.
Any help is appreciated - thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我是在寻找解决方案时来到这里的。我什么也没找到,直到我自己找到解决方案。在这里,仅供参考。我希望它能帮助某人。
I got here while looking for a solution. I did not find anything until I found a solution by myself. Here it is, just for info. I hope it helps someone.
我最近在一个项目中遇到了和你一样的问题。就我而言,fancybox 在模式窗口中正确加载了 mediaelement 播放器。然而,在 IE8 上,出现了 Flash 播放器,然后您可以看到控件被剥离并且从未被替换。
进一步查看该插件后,似乎 mediaelement 会侦听 Flash 播放器触发的事件,以便初始化播放器的控件。根据多种情况,我发现播放器在调用插件之前发出该事件,这意味着插件从未确定播放器是否准备好。
对我来说,解决方法是将 flashName 选项显式设置为 swf 的路径。然后,我只是从源中删除了对象标记,允许插件创建它。
显式设置 swf 的路径:
视频来源:
希望这有帮助!
I recently encountered the same problem as you did on a project. In my case, fancybox properly loaded the mediaelement player in the modal window. However, on IE8, the flash player was presented and you could then see the controls get stripped away and never replaced.
After looking at the plugin a bit more, it seems mediaelement listens for an event fired by the flash player in order to initialize the controls for the player. Depending on a number of circumstances, I was finding that the player was emitting that event BEFORE the plugin was called, which meant that the plugin never determined the player to be ready.
The fix for me was to explicitly set the flashName option to the path of the swf. Then, I simply removed object markup from my source, allowing the plugin to create it.
Explicitly setting the path to the swf:
Video source:
Hope this helps!
我刚刚遇到了同样的问题,事实证明,在 IE 7/8 中,如果您在显示的 div 中有 na(Flash 播放器):none Flash 播放器将无法正确加载视频。
对我来说,解决方法是不显示 div,并使用 jquery 隐藏具有 .hidden_video 类的所有 div。
执行此操作后,视频在 fancybox 中正确加载。
I have just had the same issue, it turns out than in IE 7/8 if you have na (the flash player) in a div that is display:none the flash player wont load the video correctly.
The fix for me was to take the display none off the div, and use jquery to hide all divs with a class of .hidden_video.
After doing this, the video loaded correctly in the fancybox.