2011-03-10 52 views

回答

1

是的,你可以通过Flowplayer's JavaScript API。这是an example

基本上,您只需在播放器上调用seek方法即可。

$f("player").seek(55 /* seconds */); 
+0

这正是我正在寻找的。非常感谢。出于某种原因,我只能在3小时内给你奖励。 – 2011-03-13 20:24:04

0

试试这个非常简单的例子。它适用于Chrome和Firefox。我只是使用普通的HTML 5和JavaScript和一个按钮(这是呈现相当小btw),我用从here很多信息。希望这可以帮助。

 function changeTheChapter() 
     { 

      var currentChapter = parseFloat(document.getElementById("currentChapter").value); 
      var videoPlayer = document.getElementById("tehplayer"); 

      var positon = []; 

      positon[0] = 0; 
      positon[1] = 30; 
      positon[2] = 60; 

      videoPlayer.currentTime = positon[currentChapter]; 
      document.getElementById("currentChapter").value = parseFloat(currentChapter+1); 
      //videoPlayer.currentTime = position[currentChapter]; 
     } 
    </script> 
</head> 
<body> 
    Video For Everybody Generator 
    MP4 Video Ogg Video WebM Video Poster Image Fallback Title Width Height Autoplay XML Formatting Embed as HTML5+Flash HTML5 Flash Poster Flash Player 
    Preview 
    Big Buck Bunny 

    Download video: MP4 format | Ogg format | WebM format 
    Source Code 

    <!-- "Video For Everybody" v0.4.2 by Kroc Camen of Camen Design --> 
    <video id="tehplayer" controls="controls" poster="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg" width="640" height="360"> 
     <source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" type="video/mp4" /> 
     <source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.webm" type="video/webm" /> 
     <source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.ogv" type="video/ogg" /> 
     <img alt="Big Buck Bunny" src="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg" width="640" height="360" title="No video playback capabilities, please download the video below" /> 
    </video> 
    <input type="hidden" id="currentChapter" value="0" /> 
    <p> 
     <strong>Download video:</strong> 
     <a href="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4">MP4 format</a> | <a href="http://clips.vorwaerts-gmbh.de/big_buck_bunny.ogv">Ogg format</a> | 
     <a href="http://clips.vorwaerts-gmbh.de/big_buck_bunny.webm">WebM format</a> 
    </p> 
    <button id="chapterChange" value="Go To Next" onclick ="changeTheChapter();"/> 

</body> 

+0

只是抬头看流量播放器,但是如果IE6是一个需求,你应该提一提。哦,是的,这只是一个暗示。快速示例,不想为您构建控件。 – Terrance 2011-03-11 03:42:13