mediaElementJs 和 Firefox / Safari 出现问题

发布于 2024-12-12 06:28:25 字数 1145 浏览 1 评论 0原文

我有两个问题一直困扰着我使用 MediaElement.js 开发的新网站。

首先,非常感谢您提供此内容;它确实帮助我完成了这个项目,该项目向各种平台上的用户展示了一堆视频。

我的网站有一个充满 .mov 文件的文件夹,这些文件是(据我所知,另一个人在 iMovie 中制作了视频文件)H.264 编码的。

该网站在 Chrome 中运行得很好,这是我使用的以及我在开发/测试中使用的。这些视频使用 Chrome 中的本机 HTML 5 支持来播放。

在 Firefox(多个版本)中,视频“向前滚动”到 Flash 播放器。视频播放。但是,无论我是否在完整事件处理程序中指定“player.play()”,视频都会从显示播放图标切换为显示暂停图标,但不会开始播放。用户必须单击暂停按钮,然后单击播放按钮才能播放每个视频。这是我对 mediaelement 的调用:

$('video').mediaelementplayer({
        defaultVideoWidth: 400,
...         features: ['playpause','duration','volume'<?php echo "$progressBar"; ?>],
        success: function(player, node) {
            player.play();
            player.addEventListener('ended', function(e) { 
                    $('#feedback').append('<p>Press "NEXT" to continue.</p>').promise().done(function() {
                        enableNext();
                    });
                });
        }
});

第二个问题:有时,当用户尝试使用 MacOs/Safari 使用我的网站时,他们会遇到“结束”事件处理程序似乎从未被调用的情况。在视频结束之前,我不会让人们继续浏览并单击我网站上的“下一步”按钮——这是一个培训网站,用户需要坐下来完成整个体验。我无法重现此问题,但在我找到解决方案之前我们无法上线。

I have two issues that have been plaguing a new web site I developed using MediaElement.js.

First, thanks so much for making this available; it really helped me get this project together which shows a bunch of videos to users on a variety of platforms.

My site has a folder full of .mov files, which are (from what I understand, another person made the video files in iMovie) H.264 encoded.

The site works great in Chrome, which is what I use and what I used in developing / testing. The videos play using the native HTML 5 support in Chrome.

In Firefox (several versions) the videos "fall forward" to the flash player. The videos play. However, whether or not I specify "player.play()" in the complete event handler, the video switches from showing the Play icon to showing the pause icon, but does not start playing. The user has to click the pause button, then click the play button to get each video to play. Here's my call to the mediaelement:

$('video').mediaelementplayer({
        defaultVideoWidth: 400,
...         features: ['playpause','duration','volume'<?php echo "$progressBar"; ?>],
        success: function(player, node) {
            player.play();
            player.addEventListener('ended', function(e) { 
                    $('#feedback').append('<p>Press "NEXT" to continue.</p>').promise().done(function() {
                        enableNext();
                    });
                });
        }
});

2nd problem: There are times when users have tried to use my site using MacOs / Safari that they have gotten into a situation where the 'ended' event handler doesn't seem to ever be called. I don't let people proceed through and click the "Next" button on my site until the video is ended -- this is a training site and users are required to sit through the entire experience. I have not been able to reproduce this, but we can't go live until I can come up with some fix.

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

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

发布评论

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

评论(1

陈甜 2024-12-19 06:28:25

我在 Firefox 中也遇到同样的问题。

关于结束事件:添加事件监听器后尝试调用 play() 。

I have the same problem in Firefox.

About the ended event: try calling play() after adding the event listener.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文