'I don't know why my video does not play on the html file and how I can insert multimedia file on an html file>

<!DOCTYPE html>
<head>
</head>
<body>
    <video width="400" height="400" controls>
    <source src="movie.mp4" type="video/mp4" />
    <source src="movie.mp4" type="video/ogg" />
    Your browser does not support video tag
    </video>
</body>

to wrap it up: I was trying to solve this problem in the last few days, so I give some additional information:

  1. I know mp4 is supported by Chrome 2.my video file is stored in the same folder as the html file( with the same directory) 3.some other programmers suggested using iframe so don't recommend this
  2. the same problem goes for my audio files
  3. when I write a http source instead, it does not open again.
  4. I also tried writing in the code controls="controls" too.
  5. I know I left the title part, my focus is on the body I wonder what the problem is. I really appreciate if you help me to figure that out. thank you in advance.


Solution 1:[1]

Google Chrome disables auto-play audio, so it can't auto-play video. To give autoplay, add a "muted" attribute.

<video controls autoplay muted>

Solution 2:[2]

I Found the answer to this question, in case you want to insert images, videos or audios you should take care of the directory your files are saved in, if they are in the same, which should preferably be, use this: ./image.png

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rob
Solution 2 Hanieh Jannesari