Play HTML5 video from local path in ASP.Net

Last Reply 5 months ago By kalpesh

Posted 5 months ago

I want to play my video in html5 from a specified path.Tried the code given below but didnt work...

<video width="100%" height="90%" controls autoplay loop id="myvideo" >
<source src="D:/videos/1.mp4" type="video/mp4">
<source src="D:/videos/1.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>

also tried

<video width="100%" height="90%" controls autoplay loop id="myvideo" >
<source src="file://D:/videos/1.mp4" type="video/mp4">
<source src="file://D:/videos/1.ogg" type="video/ogg">

Your browser does not support HTML5 video.
</video>

but not working...only thing working is if i save my file in my project folder and give the path as 

<source src="1.mp4" type="video/mp4">
<source src="file://D:/videos/1.mp4" type="video/mp4">

 

Posted 5 months ago Modified on 5 months ago

From Local Drive Path it will not work you need to add the video path either from Project folder or online video link to work with video tag.

also refer below link how to work with folder from the application.

Play all videos from Folder in HTML5 video player using JavaScript, C# and VB.Net