简体   繁体   中英

Cannot play MP4 videos in Chrome and IE on ASP.net

everyone.

I've got an ASP.net page that's supposed to play a particular video, but it only works in Firefox. This page uses HTML5 video tags to play it.

Here's the exact HTML that the page generates.

<!DOCTYPE HTML>
<html>
<head>
    <title>MMI Video Play</title>
    <style type="text/css">
        body, html
        {
            margin: 0px 0px 0px 0px;
        }
    </style>
</head>
<body>
    <form name="form1" method="post" action="generalVideoPlay.aspx?v=Henry-Ford-Event" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTIwNDExNTQ2NDFkZItFaUIKUt6Do1YOY8xI/g5wUtS6O2VGMvVfY/eqc5NF" />
</div>

<div style="width: 100%; text-align: center; margin-top: 12px;">
    <video width='720' height='480' controls>
        <source src="files/video/Henry-Ford-Event.mp4" type="video/mp4" />
        <source src='files/video/Henry-Ford-Event.ogv' type="video/ogg" />
        <!-- fallback to Flash: -->
        <object width='720' height='480' type="application/x-shockwave-flash" data="files/resources/player.swf">
            <param name="movie" value="files/resources/player.swf" />
            <param name="flashvars" value='file=../video/Henry-Ford-Event.mp4&image=poster.jpg' />
            <!-- fallback image. note the title field below, put the title of the video there -->
            <img src="images/noVideo.jpg" width="720" height="480" alt="No Video Playback" title="No video playback capabilities, please download the video below" />
        </object>
    </video>
    <div style="visibility: hidden; margin-top: 14px; font-family: Arial; margin-top: 18px;"><strong><a href='files/video/Henry-Ford-Event.mp4'>Download Video</a></strong></div>
</div>
</form>
</body>
</html>

Here's the list of things I've tried/learned.

  • It is absolutely pointing to the correct source because I can download and play the video from the link it provides.
  • It has nothing to do with MIME types on IIS because OGV is not there and it work in Firefox. Furthermore, I added MP4 to IIS and it still doesn't work.
  • I've copy-pasted the above HTML into an HTML file (as opposed to an aspx file) I made on my local drive and it works just fine.

I really don't know what else to try. The thing that kills me is that the HTML works in and of itself, but when I run it from the site it gives nothing. I'll greatly appreciate an answer to this problem.

EDIT: I've also found this page ( http://geekswithblogs.net/ranganh/archive/2011/11/03/making-html5-video-work-with-iis-express.aspx ) and can safely say that, while the symptoms are the same, I am not finding a stream/octet MIME type issue.

Well, I managed to get this sorted out. Ultimately I gave up on doing pure HTML5 and went for JWPlayer which works quite well. Though, even when I started using that, I still couldn't get things to work perfectly. The final piece of the puzzle was ripping the videos from the DVD again using Handbrake and checking the "Web Optimized" option. That, combined with JWPlayer, has completely solved my issue. I hope this helps out some other poor soul who has to do Web video work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM