Firefox、Safari 的 MediaElement 问题

发布于 2024-12-23 18:32:14 字数 304 浏览 4 评论 0原文

我在尝试在同时使用 dojo(主要 JS 框架)和 jquery(专门添加以启用 MediaElement)的网站上使用 MediaElement 时遇到问题。

以下代码行:

$('audio').mediaelementplayer({plugins:['flash'],pluginPath:'/app/public/js/mediaelement/'});

... 导致 Firefox 中出现某种脚本循环。该警报特别指向 jquery.js 中的第 3895 行。当上面的行被注释掉时,问题就消失了。

I am running into an issue trying to use MediaElement on a site that uses both dojo (primary JS framework) and jquery (added specifically to enable MediaElement).

The following line of code:

$('audio').mediaelementplayer({plugins:['flash'],pluginPath:'/app/public/js/mediaelement/'});

... is causing some sort of script loop in Firefox. The alert specifically points to line 3895 in jquery.js. The problem goes away when the above line is commented out.

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

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

发布评论

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

评论(1

深居我梦 2024-12-30 18:32:14

如果您使用 CSS 隐藏播放器的任何元素,例如 display:none;,那么您将在 Firefox 中收到无响应脚本错误。确保您没有隐藏任何播放器元素,并使用 features 选项设置您需要的控件。

示例代码:

$("audio").mediaelementplayer( {
     plugins: ['flash']
   , pluginPath: '/app/packages/mediaelement-2.6.5/build/'
   , flashName: 'flashmediaelement.swf'
   , features: ['playpause','progress','current','duration']
 });

If you hide any element of the player with CSS, e.g. display:none; then you will get an unresponsive script error in Firefox. Make sure you are not hiding any player elements, and use the features option to set the controls you need.

Example code:

$("audio").mediaelementplayer( {
     plugins: ['flash']
   , pluginPath: '/app/packages/mediaelement-2.6.5/build/'
   , flashName: 'flashmediaelement.swf'
   , features: ['playpause','progress','current','duration']
 });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文