Why can’t HTML embedded MP4 video play

Time:2021-4-18

The following code is in my test.html Through the absolute path, such as C:\ test.html Access can play video, but through: http://localhost/test.html Mode access can’t play, it just loads a player in the page, and all the buttons don’t work. I don’t know where the problem is, but according to my estimation, it doesn’t have much to do with the code The code is as follows:

Copy code

The code is as follows:

<object width=”300″ height=”300″ type=”video/x-ms-asf” url=”http://localhost/younao01.mp4″ data=”younao01.mp4″ classid=”CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6″>
<param name=”url” value=”younao01.mp4″>
<param name=”filename” value=”younao01.mp4″>
<param name=”autostart” value=”1″>
<param name=”uiMode” value=”full” />
<param name=”autosize” value=”1″>
<param name=”playcount” value=”1″>
<embed type=”application/x-mplayer2″ src=”http://localhost/younao01.mp4″ width=”100%” height=”100%” autostart=”true” showcontrols=”true” pluginspage=”http://www.microsoft.com/Windows/MediaPlayer/”></embed>
</object>

After checking, it is found that it has nothing to do with the code. The specific reason is that there is no MP4 mapping in IIS. The solution is as follows:

win7
Control panel – view method (upper right corner) – small icon – management tools – Internet information services (IIS) manager – click your website name on the left side – double click “MIME type” on the right side – click add on the far right side – fill in the file extension. MP4, and the mime type is video / MP4 or application / octet stream. All these are OK. That’s it!