2011-09-28 110 views
0

正在從Flash切換到Flash播放器/ html5視頻播放器混合解決方案。使用video.js播放器。我正在尋找隱藏播放器,並在視頻完成後用javascript顯示div塊。誰會知道如何觸發這個?我有一個SWF容器和一個視頻容器。任何人有任何建議?需要在視頻結束時觸發事件

www.friedmanllp.com/home3.php

以下代碼:

<div class="video-js-box"> 
     <!-- Using the Video for Everybody Embed Code http://camendesign.com/code/video_for_everybody --> 
     <video id="example_video_1" class="video-js" width="545" height="380" controls="controls" preload="auto" poster="http://www.friedmanllp.com/video/video.jpg"> 
      <source src="http://www.friedmanllp.com/video/intro.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /> 
      <object id="flash_fallback_1" class="vjs-flash-fallback" width="545" height="380" type="application/x-shockwave-flash" 
      data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf"> 
      <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" /> 
      <param name="allowfullscreen" value="true" /> 
      <param name="flashvars" value='config={"playlist":["http://www.friedmanllp.com/video/video.jpg", {"url": "http://www.friedmanllp.com/video/intro.mp4","autoPlay":true,"autoBuffering":true}]}' /> 
      <!-- Image Fallback. Typically the same as the poster image. --> 
      <img src="http://www.friedmanllp.com/video/video.jpg" width="545" height="380" alt="Poster Image" 
       title="No video playback capabilities." /> 
      </object> 
     </video> 
     <!-- Download links provided for devices that can't play video in the browser. --> 
    </div> 

    <div style="display:none; width:545px; height:380px; overflow:hidden;"> 
     <div class="practices_link" style="float:left; margin-bottom:1px; width:95px; height:17px; cursor:pointer;"><img class="practices_on" style="margin-bottom:1px; width:95px; height:17px;" src="images/alt/practices_on.jpg" /><img class="practices_off" style="display:none; margin-bottom:1px; width:95px; height:17px;" src="images/alt/practices_off.jpg" /></div><div style="float:left; margin-bottom:1px; width:355px; height:17px;"><img src="images/alt/blank_alt.gif" style="width:355px; height:17px;"></div><div class="services_link" style="float:left; margin-bottom:1px; width:95px; height:17px;"><img class="services_off" style="margin-bottom:1px; width:95px; height:17px; cursor:pointer;" src="images/alt/services_off.jpg" /><img class="services_on" style="display:none; margin-bottom:1px; width:95px; height:17px; cursor:pointer;" src="images/alt/services_on.jpg" /></div> 
     <div id="slider"> 
      <div id="practices" style="float:left; top:0; left:0; position:relative;"> 
       <a href="http://www.friedmanllp.com/articles.php?pcode=1"><img style="margin-bottom:1px;" src="images/alt/1.jpg" /></a> 
       <a href="http://www.friedmanllp.com/articles.php?pcode=5"><img style="margin-bottom:1px;" src="images/alt/2.jpg" /></a> 
       <a href="http://www.friedmanllp.com/articles.php?pcode=13"><img style="margin-bottom:1px;" src="images/alt/3.jpg" /></a> 
       <a href="http://www.friedmanllp.com/articles.php?pcode=2"><img style="margin-bottom:1px;" src="images/alt/4.jpg" /></a> 
       <a href="http://www.friedmanllp.com/articles.php?pcode=18"><img style="margin-bottom:1px;" src="images/alt/5.jpg" /></a> 
       <a href="http://www.friedmanllp.com/articles.php?pcode=28"><img style="margin-bottom:1px;" src="images/alt/6.jpg" /></a> 
      </div> 
      <div id="services" style="float:left; top:-360px; left:545px; position:relative;"> 
       <a href="http://www.friedmanllp.com/articles.php?pcode=21"><img style="margin-bottom:1px;" src="images/alt/7.jpg" /></a> 
       <a href="http://www.friedmanllp.com/articles.php?pcode=7"><img style="margin-bottom:1px;" src="images/alt/8.jpg" /></a> 
       <a href="http://www.friedmanllp.com/articles.php?pcode=29"><img style="margin-bottom:1px;" src="images/alt/9.jpg" /></a> 
       <a href="http://www.friedmanllp.com/articles.php?pcode=30"><img style="margin-bottom:1px;" src="images/alt/10.jpg" /></a> 
       <a href="http://www.friedmanllp.com/articles.php?pcode=14"><img style="margin-bottom:1px;" src="images/alt/11.jpg" /></a> 
       <a href="http://www.friedmanllp.com/articles.php?pcode=17"><img style="margin-bottom:1px;" src="images/alt/12.jpg" /></a> 
      </div> 
     </div> 
     </div> 
+0

HTML5視頻應該有一個「結束」事件,當視頻結束時觸發。 – krasnerocalypse

+0

你有沒有考慮[html5] [1]? [1]:http://stackoverflow.com/questions/2741493/how-do-you-detect-html5-video-events –

+0

你有沒有考慮[HTML5] [1]? [1]:http://stackoverflow.com/questions/2741493/how-do-you-detect-html5-video-events –

回答

0

我尋找隱藏的球員,顯示出與在視頻整理JavaScript的一個div塊。

查看您的視頻播放器的文檔是否有它的事件;如果沒有,更換球員。

JPlayer has events, for example

+0

我用下面得到它:。 $(文件)。就緒(函數(){ \t $( '#example_video_1')綁定( 「結束」,函數(){ \t $(」視頻JS (''''); css('display','none'); \t $('#slider')。css('display','block'); \t}); }); –

+0

我用下面得到它:。 $(文件)。就緒(函數(){ \t $( '#example_video_1')綁定( 「結束」,函數(){ \t $(」視頻JS (''''); css('display','none'); \t $('#slider')。css('display','block'); \t}); }); 雖然我不認爲這將作爲一個完整的跨瀏覽器解決方案。 IE7和IE8不支持視頻標籤。我在作品中發現了一個黑客攻擊項目,但尚未使用。 而我試圖不用重建的Flash文件,我很可能必須從頭開始。並使用圖像幻燈片作爲iPad和iPhone的後備。 –

+0

@Dave很高興聽到它爲你工作! –

相關問題