【问题标题】:How do I show a local video file with object and embed tags?如何显示带有对象和嵌入标签的本地视频文件?
【发布时间】:2012-04-30 07:53:03
【问题描述】:

所以我的视频文件在 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>

【问题讨论】:

  • WMP 显示但没有播放。
  • 如果直接在浏览器中打开视频网址会怎样?它是否显示“另存为”对话框、打开 WMP 或显示错误页面?还可以尝试右键单击播放器,看看它是否显示错误/错误代码(应该)。将其发布在您的问题中。

标签: html video embed object-tag


【解决方案1】:

尝试一些更简单的开始,例如:

<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> 

【讨论】:

  • 其中任何一个?发生了什么?
【解决方案2】:
<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 中,提供相对路径而不是绝对路径总是好的。

【讨论】:

    【解决方案3】:

    这至少有效。

    <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>
    

    【讨论】:

      猜你喜欢
      • 2013-09-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-17
      • 2019-09-23
      • 2012-02-11
      相关资源
      最近更新 更多