如何使用html5视频标签播放dnn中所有格式的视频?

时间:2012-02-09 13:16:13

标签: dotnetnuke html5-video

我正在使用html5视频标签来播放dnn.Here .mov视频中的视频只能在dnn中播放,但我想播放.mp4,.flv,.mpeg等正常的aspx页面每个视频播放但是仅限.mov。

<html5:Video ID="video1" runat="server" Url="~/Videofiles/trailer_480p.mov" Width="300" Height="300" DisplayControls="true" AutoPlay="true"></html5:Video>

这在dnn中运行良好,但如果我想播放.mp4则不支持。 我也尝试过这样:

<video width="320px" height="240px" autobuffer="autobuffer" autoplay="autoplay"  controls="controls" poster="/video/thumb/vide1.jpg">    
<source src='Videofiles/VIDEO  India.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>    

任何想法都赞赏。

1 个答案:

答案 0 :(得分:2)

您是否尝试过在IIS中启用MP4?默认情况下,我不相信IIS会允许该mime类型。

您需要在IIS中添加它 扩展名:mp4 MIME类型:video / mpeg

如果您使用以下代码使用IIS7,则可以将其添加到web.config中。

<system.webServer>
        <staticContent>
            <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
            <mimeMap fileExtension=".m4v" mimeType="video/m4v" />
     </staticContent>
    </system.webServer>