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"  />
 </video>

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"  />
</video>

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

C:/Users/Shruti/Desktop/index.mp4

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"  />
</video>

Leave a Reply

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