Why can't the MP4 format video embedded in HTML be played?

Why can't the MP4 format video embedded in HTML be played?
The following code is in my test.html. The video can be played when accessed through an absolute path such as c:\test.html, but it cannot be played when accessed through: http://localhost/test.html. It only loads a player on the page, and none of the buttons work. I don't know where the problem is, but I guess it has nothing 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, I found that it really had nothing to do with the code. The specific reason was that there was no MP4 mapping in IIS. The solution is as follows:

Win7 :
Control Panel – View as (upper right corner) – Small icons – Administrative Tools – Internet Information Services (IIS) Manager – Click your website name on the left – Double-click “MIME Type” on the right – Click Add on the far right – Fill in .mp4 as the file extension, and Video/mp4 or application/octet-stream as the MIME type. All are OK. That’s it!

<<:  Web Theory: Don't make me think Reading Notes

>>:  Detailed explanation of the reasons why MySQL connections are hung

Recommend

Detailed explanation of encoding issues during MySQL command line operations

1. Check the MySQL database encoding mysql -u use...

Simple web page code used in NetEase blog

How to use the code in NetEase Blog: First log in...

Two ways to build a private GitLab using Docker

The first method: docker installation 1. Pull the...

Better-scroll realizes the effect of linking menu and content

1. Basic use <!DOCTYPE html> <html lang=...

Introduction to the process of building your own FTP and SFTP servers

FTP and SFTP are widely used as file transfer pro...

Detailed steps for deepin20 to install NVIDIA closed-source drivers

Step 1: Install the deep "graphics driver&qu...

MySQL independent index and joint index selection

There is often a lack of understanding of multi-c...

Detailed explanation of HTML page header code example

Knowledge point 1: Set the base URL of the web pa...

MySQL multi-table query detailed explanation

Eating well and getting enough rest sounds simple...

Detailed explanation of html-webpack-plugin usage

Recently, I used html-webapck-plugin plug-in for ...

25 Examples of Using Circular Elements in Web Design

Today, this post lists some great examples of circ...

How to pass the value of the select drop-down box to the id to implement the code

The complete code is as follows : HTML code: Copy ...