Windows Server 2008 r2 + IIS7: .mp4 files can not be played

雨燕双飞 提交于 2020-01-11 12:37:11

问题


I have the strange trouble.Folder of web application in my server (IIS7.5, Windows Server 2008 R2). Web application has Video player.

 <asp:Repeater ID="Repeater1" runat="server">
                        <ItemTemplate>
                      <video src='<%# ResolveUrl(GetVideoHandler(Eval("id"))) %>' width="900" height="400" controls="" preload=""></video>
                        </ItemTemplate>
                    </asp:Repeater>

It can play .mp4 on my local System, but it don't play on live server when i accessing a video on other system.i have a Value gettong in ResolveUrl(GetVideoHandler(Eval("id"))) VideoFolder/VideoName.mp4 for playing video. Its working fine on my loaclHost during developing but don't working when Im accessing it web link on other computer. Have anybody idea? Thanks.


回答1:


Add the mime type to the server or web application web.config, (or in IIS under mime types).

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



回答2:


it's a quite a simple answer: Windows server 2008 has no mpeg-4 multiplexer, so you cant see any mp4 on your machine with default configuration of your server.

you can notice that if you stand with your mouse cursor on a video file in your computer you will able to see basic file info like name and duration.

at your server you might find out that if you do the same on an mp4 media file you will not able to see this information...

the answer for that issue is to go to server manager under the administrative tools in your windows server 2008 r2 from the start menu.

from there you need to choose features in the left side. after that you need to prees add features and select DESKTOP EXPERIENCE and install.

this is the primary thing you need do do for you machine to be able to read mp4 info. after that you need to mime type for your mp4 media files. install codecs.



来源:https://stackoverflow.com/questions/18258125/windows-server-2008-r2-iis7-mp4-files-can-not-be-played

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!