Home > Net >  how can I play videos on html?
how can I play videos on html?

Time:03-03

<video  width="500" height="500" controls="contrlos">
  <source src="hope.mp4" type="video/mp4">
</video> 

this is the code I tried on vscode, the video file is stored in my drive c, but I don't know why when I run it, it doesn't work, and I cannot play the video. by the way I open it in Chrome. and when I google a video and copy the link address in src="" the same problem repeat. does the audio and video files we want to put in html need to be stored in a special place in my computer?? plz help me! I'm beginner.

CodePudding user response:

You can also use the iframe tag to display videos, use

<iframe width="465" height="315" src="path-to-your-video.mp4"></iframe>

CodePudding user response:

Make sure your index.html file and hope.mp4 are in the same folder. Alternatively you can put the whole path to your mp4 file in the src but it's always a good practice to keep all of you files inside a same project folder.

CodePudding user response:

Hanieh Jannesari Have a view of the link https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_video_all

  • Related