0

我正在使用以下内容在浏览器中显示一个 .mp4 文件:-

<![if !IE]> 
    <video width="480" height="360" controls="controls">
        <source src="<?php echo $video; ?>" type="video/mp4">
        <param name="src" value="<?php echo $video; ?>" />
        <param name="autoplay" value="true" />
    </video>
<![endif]>

<!--[if IE]>
    <object width="480" height="360" type="application/x-mplayer2" codebase="http://www.microsoft.com/Windows/MediaPlayer/">
    <param name="Filename" value="<?php echo $video; ?>">
    <param name="AutoStart" value="true">
    <param name="ShowControls" value="true">
    <param name="BufferingTime" value="2">
    <param name="ShowStatusBar" value="true">
    <param name="AutoSize" value="true">
    <param name="InvokeURLs" value="false">
    </object>
<![endif]-->

在 IE 中,它正在显示文件,但在 chrome 中不起作用。但是,如果我使用相同的代码并将 src 更改为已经位于网络上的视频,它可以工作:-

<video width="480" height="360" controls="controls">
        <source src="http://ia700204.us.archive.org/2/items/Pbtestfilemp4videotestmp4/video_test_512kb.mp4" type="video/mp4">
        <param name="src" value="http://ia700204.us.archive.org/2/items/Pbtestfilemp4videotestmp4/video_test_512kb.mp4" />
        <param name="autoplay" value="true" />
    </video>

我也尝试过嵌入代码:-

<embed src="<?php echo $video; ?>" type="application/x-mplayer2" autostart="1" enabled="1" showstatusbar="1" showdisplay="1" showcontrols="1" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0" width="480" height="360"></embed>

如果是代码问题,那么即使是网上可用的 .mp4 文件也不应该播放。如果是源问题,则该文件不应在 Internet Explorer 中播放。

有人可以帮我解决这个问题吗?

4

1 回答 1

0

The answer is really easy all you needed to do is this

<embed src="http://ia700204.us.archive.org/2/items/Pbtestfilemp4videotestmp4/video_test_512kb.mp4" height="200" width="500" />

This is just the easiest possible solution and I'm sure there are different ways too.

于 2013-03-27T03:04:23.240 回答