开发者

forwarding embedded video to a certain place

there. I know that there is a possibility开发者_高级运维 to open a video file either using a flash player or html5 in a browser, but is there a possibility to open it at the certain place (lets say 60 seconds from the beginning) or automatically fast forward it after opening? Any code examples would be appreaciated.


Ok, I had to find the answer myself. A similar question was addressed at How do I play just a specific section of a video in a web page? (but without giving specific examples). I found out that for flv types you can use flowplayer:

http://flowplayer.org/documentation/scripting.html

My minimal working example:

    <html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="flowplayer-3.2.4.min.js"></script>
    <title>Minimal Flowplayer setup</title>

</head>
<body>

<div style="display:block;width:520px;height:330px" id="player"> </div>     

</body>
<script> 
$f("player", "../flowplayer-3.2.5.swf", {
    clip: {
        url: "four_stroke.flv",
        autoPlay: true
    },
     // you can seek to a certain place of a clip just after that place is already is buffered
    onStart:function() { 
    this.seek(10);
    }
});
</script>
</html>

For quicktime movie types you can use quicktime plugin and set start or autoplay parameters to start a video clip at specified place like that:

<PARAM Name="AUTOPLAY" Value="@00:03:15:01" >

or

<PARAM NAME="STARTTIME" VALUE="00:03:15:01" >

more explanations at: http://developer.apple.com/library/mac/#documentation/QuickTime/Conceptual/QTScripting_HTML/QTScripting_HTML_Document/ScriptingHTML.html

Here is my code example that works in my FF3.6 and IE8 (put it in your HTML's body area):

    <OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" 
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab" 
HEIGHT=650 
WIDTH=1000 
> 

<PARAM NAME="src" VALUE="ksetup.mov" >

<PARAM NAME="STARTTIME" VALUE="00:03:00:00" > 

<PARAM NAME="AUTOPLAY" VALUE="false" > 

<EMBED 
SRC="ksetup.mov" 
HEIGHT=650 WIDTH=1000
TYPE="video/quicktime"
BGCOLOR=#00ff00
AUTOPLAY="false"
STARTTIME="00:03:00:00" 
PLUGINSPAGE="http://www.apple.com/quicktime/download/" 
/> 

</OBJECT> 

Hope this will put someone on track.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜