2012-11-13 46 views
-2

我的網頁有一個創建視頻播放器的問題。我有一個視頻標題列表和一個使用對象標題的視頻播放器。創建支持IE和Firefox的視頻播放器

我的目的:當我點擊視頻標題時,它會加載視頻並根據視頻文件播放。

任何人都可以幫助我解決這個問題嗎?

+2

郵編,錯誤消息,瀏覽器/ OS版本,需要更多的信息。 – Kayo

回答

0

Try the demo

<a href="http://v2v.cc/~j/theora_testsuite/320x240.ogg">Test video</a><br> 
<a href="http://upload.wikimedia.org/wikipedia/commons/9/9b/Pentagon_News_Sample.ogg">Pentagon</a><br> 
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/1/14/Xacti-AC8EX-Sample_video-001.ogg/Xacti-AC8EX-Sample_video-001.ogg.480p.webm">Cat Giraffe</a><br> 

<video id="player" src="http://v2v.cc/~j/theora_testsuite/320x240.ogg" controls> 
    Your browser does not support the <code>video</code> element. 
</video>​​​​​​​​​​​​​ 

<script type="text/javascript"> 
​$(function(e) { 
    $('a').click(function(e) { 
     e.preventDefault(); 
     var video_file = $(this).attr('href'); 
     $('#player').attr('src', video_file)[0].play(); 
    });   
});​ 
</script> 
相關問題