Flowplayer 不会使用 jQuery 函数 stop()
我正在开发的 WordPress 网站上使用 VideoJS HTML5 视频播放器。播放器在模态窗口中启动,并且在大多数情况下都工作得很好,但是 IE 的 Flowplayer flash 后备功能并没有按照我想要的方式运行。
当用户关闭模式框时,播放应该停止/暂停。这在 HTML5 中工作得很好,但在 Flowplayer 中却不行。我查看了 Flowplayer 文档,但似乎无法让他们建议的代码工作。我尝试了几种变体,但没有运气,并且无法在网上找到有效的示例。
值得注意的是,VideoJS 是从 WordPress 调用的,使用 VideoJS WP 插件。
下面的代码片段显示了我认为它应该起作用的内容,其中 $f 是流程播放器选择器,但我尝试了其他方法。
jQuery(function( $ ){
$(document).ready(function(){
$('.bClose').click(function(){
$(".video-js")[0].player.pause();
$f("video_1").stop(); /* <-- THIS IS THE OFFENDING LINE OF CODE. */
$('.video-js-box').bPopup().close();
});
});
});
我正在使用 HTML5 样板,此代码位于我的 script-starter.js 文件中。
看看有问题的网站
我希望有人可以帮助我让它发挥作用。
提前致谢。
sPieLMaN
更新:现在正在尝试这个主题的变体......
$('.bClose').click(function(){
$(".video-js")[0].player.pause();
$f($(".video-js-box").get(0)).pause();
$('.video-js-box').bPopup().close();
});
I am using the VideoJS HTML5 video player on a WordPress site I'm developing. The player launches in a modal window, and it works great for the most part, but the Flowplayer flash fallback for IE isn't behaving as I want.
When the user closes the modal box, playback should stop/pause. This works fine in HTML5, but not with Flowplayer. I've had a look at Flowplayer documentation but can't seem to get their suggested code to work. I've tried several variations, with no luck and cannot find a working example on the net.
It may be worth noting that VideoJS is called from WordPress, using VideoJS WP plugin.
The snippet below shows what I think it should work, where $f is the flow player selector, but I've tried other ways.
jQuery(function( $ ){
$(document).ready(function(){
$('.bClose').click(function(){
$(".video-js")[0].player.pause();
$f("video_1").stop(); /* <-- THIS IS THE OFFENDING LINE OF CODE. */
$('.video-js-box').bPopup().close();
});
});
});
I'm working from the HTML5 boilerplate, and this code is in my script-starter.js file.
Take a look at the site under question
I hope someone can help me get this to work.
Thanks in advance.
sPieLMaN
UPDATE: Am trying variations on this theme now...
$('.bClose').click(function(){
$(".video-js")[0].player.pause();
$f($(".video-js-box").get(0)).pause();
$('.video-js-box').bPopup().close();
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无论您的模态插件是什么,请在模态文档中找到 Closed 方法,然后您可以执行
$(video).remove();
或Whatever is your modal plugin , find on Closed method in your modal documentation thenn u can do
$(video).remove();
or