2012-04-18 65 views
2

所以我的視頻文件在C:\ inetpub \ wwwroot \ Videos \ Test \ intro.wmv。我只想在我的網頁上本地運行視頻。如何使用對象和嵌入標籤顯示本地視頻文件?

它必須在IE8/WinXP上運行。所以沒有HTML5。

這是我到目前爲止有:

<object width="100%" height="100%" 
type="video/x-ms-asf" url="http://localhost/Videos/Test/intro.wmv" data="intro.wmv" 
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"> 
<param name="url" value="http://localhost/Videos/Test/intro.wmv"> 
<param name="filename" value="intro.wmv"> 
<param name="autostart" value="1"> 
<param name="uiMode" value="full" /> 
<param name="autosize" value="1"> 
<param name="playcount" value="1"> 
<embed type="application/x-mplayer2" src="http://localhost/Videos/Test/intro.wmv" width="100%" height="100%" autostart="true" showcontrols="true" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"></embed> 
</object> 
+0

發生了什麼事? – 2012-04-18 20:16:10

+0

WMP顯示,但沒有播放。 – dotnetN00b 2012-04-18 20:21:27

+0

如果您直接在瀏覽器中打開視頻網址,會發生什麼情況?它是否顯示「另存爲」對話框,打開WMP或顯示錯誤頁面?也可以嘗試右鍵點擊播放器,看看它是否顯示錯誤/錯誤代碼(它應該)。發佈在你的問題。 – 2012-04-18 21:45:16

回答

3

嘗試一些更簡單的開始,如:

<object data="./Videos/Test/intro.wmv" type="video/x-ms-wmv" width="100%" height="100%"> 
    <param name="src" value="./Videos/Test/intro.wmv"> 
    <param name="autoStart" value="1"> 
    alt : <a href="./Videos/Test/intro.wmv">My video name</a> 
</object> 

或HTML5

<video width="320" height="240" controls="controls">  
    <source src="./Videos/Test/intro.wmv" type="video//x-ms-wmv" />  
    <!-- <track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English"> -->  
    Nav doesn't support html5 video 
</video> 
+0

這沒有奏效。 – dotnetN00b 2012-04-18 20:44:31

+0

任何這些?發生了什麼 ? – Day 2012-04-18 20:59:23

0
<video width="320" height="240" controls="controls"> 
    <source src="movie.mp4" type="video/mp4" /> 
    <source src="movie.ogg" type="video/ogg" /> 
    <source src="movie.webm" type="video/webm" /> 
<object data="movie.mp4" width="320" height="240"> 
    <embed src="movie.swf" width="320" height="240" /> 
</object> 
</video> 

保存爲HTML文件放在視頻所在的同一文件夾中他在html 5中,其總是給予相對路徑的絕對路徑。

+0

這是一個WMV視頻! – 2012-04-18 21:46:02

0

這起作用至少。

<object width="100%" height="100%" 
type="video/x-ms-asf" url="/wiki/Videos/Test/intro.wmv" data="/wiki/Videos/Test/intro.wmv" 
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"> 
<param name="url" value="/wiki/Videos/Test/intro.wmv"> 
<param name="filename" value="/wiki/Videos/Test/intro.wmv"> 
<param name="autostart" value="1"> 
<param name="uiMode" value="full" /> 
<param name="autosize" value="1"> 
<param name="playcount" value="1"> 
<embed type="application/x-mplayer2" src="/wiki/Videos/Test/intro.wmv" width="100%" height="100%" autostart="true" showcontrols="true" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"></embed> 
</object>