2

视频无法播放:

<asp:DataList ID="DL_Media" runat="server">
    <ItemTemplate>
        <video src="windowsmedia.ogg" controls="controls" width="215" height="160">
            <object id='mediaPlayer' width="215" height="160"
                        classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
                        codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
                        standby="Loading Microsoft Windows Media Player components..."
                        type="application/x-oleobject">
                <param name="fileName" value="res/Files/test.wmv" >
                <param name="animationatStart" value="true">
                <param name="transparentatStart" value="true">
                <param name="autoStart" value="true">
                <param name="showControls" value="true">
                <param name="loop" value="true">
            </object>
        </video>
    </ItemTemplate>
</asp:DataList>
4

2 回答 2

2

确保您的浏览器兼容

首先,确保您尝试查看的浏览器支持 HTML 5 视频元素

示例代码

无耻地取自Mozilla 的开发者网站

嵌入视频

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

嵌入具有多个来源的视频

<video controls>
  <source src="foo.ogg" type="video/ogg">
  <source src="foo.mp4" type="video/mp4">
  Your browser does not support the <code>video</code> element.
</video>

指定所需的编解码器

<video controls>
  <source src="foo.ogg" type="video/ogg; codecs=dirac, speex">
  Your browser does not support the <code>video</code> element.
</video>

该站点上的其他示例包括控制播放回退选项

于 2013-10-21T14:47:21.443 回答
0

使用source代替对象

<video controls>
  <source src="res/Files/test.wmv" type="video/wmv"> 
  Your browser does not support the <code>video</code> element.
</video>
于 2013-10-21T14:50:22.020 回答