Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to create an aspx page on visual studio 2010 framework 4.0 which displays videos. Now I have used this simple code but it is downloading videos instead of displaying them (same issue if the video was .mp4 or .wmv):

ASP.NET
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <iframe width="560" 
                height="315" 
                src="TEST VIDEO.mp4" 
                frameborder="0" 
                allowfullscreen></iframe>
    
</body>
</html>


I have tried to create a simple html page on notepade++ with this simple code:

HTML
<!DOCTYPE html>
<html>
<head>
  <title>Silverlight Video</title>
</head>
<body>
   <video width="320" height="240" controls="controls">
      <source src="C:/Users/Public/Videos/Sample Videos/TEST VIDEO.mp4" type="video/mp4" />
	  
  </video>
</body>
</html>


Video is working perfectly on Chrome but on firefox it returns this error:
No Video with supported Format and MIME found, and on IE it returns Invalid Source.

To sum up, how can I solve one of these 2 problems and display the video on those three browsers?

What I have tried:

I have added the MIME in IIS manager as I am using windows 7 to solve the problem on IE but not working.
Posted
Updated 19-Jan-17 6:12am
Comments
Richard Deeming 19-Jan-17 12:22pm    
MP4 is a container format. Browser support depends on how the video and audio tracks are encoded within the container. Firefox also depends on support from the OS in some cases, to avoid patent issues.

Media formats supported by the HTML audio and video elements[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900