[英]Can't stop / Pause Flash HTML5 Video Fallback with jQuery
I am looking to do something that should be quite simple but have not found anything online to properly address the issue. 我希望做的事情应该很简单,但还没有找到任何在线解决方法。
I have an HTML5 video loading in a popup. 我在弹出窗口中加载了HTML5视频。 When the user closes the popup the video keeps playing.
当用户关闭弹出窗口时,视频将继续播放。 Since it is a short video with controls on it I am indifferent to if it stops or pauses however I cannot find anything to make this happen.
由于这是一部带有控件的简短视频,因此无论它停止还是暂停,我都无所谓,但是我找不到任何能够实现这一目标的东西。
The code is shown below: 代码如下所示:
<video id="myVid" height="510">
<source src="http://thisisanexample.com/mobile.mp4" type="video/mp4">
<source src="http://thisisanexample.com/mobile.ogv" type="video/ogg">
<object type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" width="700" height="467">
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="transparent" />
<param name="flashVars" value="config={'playlist':[{'url':'http://thisisanexample.com/mobile.mp4','autoPlay':true}]}" />
<img alt="" src="" width="700" height="467" title="No video playback capabilities" />
</object>
You're not using HTML5 video. 您没有使用HTML5视频。 HTML5 videos use the
<video>
tag. HTML5视频使用
<video>
标签。 What you've got there is a Flash embed. 您所拥有的是Flash嵌入。
http://en.wikipedia.org/wiki/HTML5_video http://en.wikipedia.org/wiki/HTML5_video
Edit #1: The original question didn't have the video tags in place. 编辑#1:原始问题没有视频标签。 Answering most obvious problem for the information given:
针对给出的信息回答最明显的问题:
I'm guessing you're doing $('#myVid').pause()
before hiding the lightbox. 我猜你在隐藏灯箱之前正在做
$('#myVid').pause()
。 You'll need to do $('#myVid')[0].pause()
as pause()
is not defined in jQuery. 您需要执行
$('#myVid')[0].pause()
因为jQuery中未定义pause()
。
Edit #2: If you want to pause the Flash video (which is using Flowplayer), you need to use the Flowplayer API. 编辑2:如果要暂停Flash视频(正在使用Flowplayer),则需要使用Flowplayer API。 http://flash.flowplayer.org/documentation/scripting.html
http://flash.flowplayer.org/documentation/scripting.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.