Home > Enterprise >  Video auto play with sound
Video auto play with sound

Time:03-17

I have tried this code for video auto play with sound.

 <video width="320" height="240" controls="controls" autoplay="autoplay">
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>

Based on the above code I have changed my code, convert my video in to .ogg format and update it my code.

What I got is video autoplay and sound is not working.

<video width="320" height="256" autoplay="autoplay" controls="controls" id="vid" muted>
<source type="video/mp4" src="video_file.mp4"></source>
<source type="video/ogg" src="video_file.ogg"></source>
</video>

i have tried above code , then autoplay is working but no sound

Please check this : https://www.fayfachemicals.com/audio/

Here is an example where autoplay with sound is working. I need something like this, but cant figure out how they implemented it.

https://olafwempe.com/

Would appreciate any advice and help!

CodePudding user response:

Remove muted attribute from your tag video

CodePudding user response:

<video width="320" height="256" autoplay="autoplay" controls="controls" id="vid">
<source type="video/mp4" src="video_file.mp4"></source>
<source type="video/ogg" src="video_file.ogg"></source>
</video>

  • Related