How do I use Video tag in HTMl in this cod-ThrowExceptions

Exception or error:

I have this code but it doesn’t load video.

<video width="500" height="400" controls>
 <source src="C:\Users\Shruti\Desktop\index.mp4"  type="video/mp4"  />

How to solve:

First of all try to check if the file path is correct and is accessible.

<video width="500" height="400" controls="">
  <source src="C:/Users/Shruti/Desktop/index.mp4"  type="video/mp4"  />

Try to navigate to the path in explorer by just submitting the URL.


Also when uploading or may previewing you will have to provide absolute or relative paths to make the URL work.

<video width="500" height="400" controls="">
  <source src="/SomeFolderInWebspace/index.mp4"  type="video/mp4"  />

Leave a Reply

Your email address will not be published. Required fields are marked *