Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to embed a MP4 video in ASP MVC cshtml?

I enhance a mobile page by ASP MVC. How can I embed the video file in the cshtml page that iphone/android can autoplay the video when browse the page?

Need to use html5 ?

Thanks

Joe

like image 593
Joe Yan Avatar asked Nov 15 '25 17:11

Joe Yan


1 Answers

There is no difference between ASP.NET MVC or any other web development framework.

Here is sample from w3schools.com on HTML5 video autoplay Attribute

<video controls="controls" autoplay="autoplay">
  <source src="movie.mp4" type="video/mp4" />
  <source src="movie.ogg" type="video/ogg" />
  Your browser does not support the video tag.
</video> 
like image 171
Jahan Zinedine Avatar answered Nov 17 '25 08:11

Jahan Zinedine