I have simple audio in my app I want to add audio to play automatically when the user open in my site via LinkedIn browser
Here is my html
<audio onloadeddata="this.play()" id="audioplayer" playsinline="true" webkit-playsinline controls loop autoplay muted>
<source src="audio/muzyka_meed_loop.mp3" type="audio/mpeg"> Your browser does not support the audio element.
</audio>
Unfortunately, this is not working
What do I need to change to get this working?
You have do it like below. Add "autoplay" to audio tag.
<audio autoplay id="audioplayer" controls>
<source src="audio/muzyka_meed_loop.mp3" type="audio/mpeg">Your browser does not support the audio element.
</audio>
Note: The audio tag is not supported in Internet Explorer 8 and earlier versions.
Related
how to make html5 video controls always on/show (without mouse hover) .? currently the video controls show only on mouse hover while playing video. i have tried "controls:true" attribute but which does not help in video tag. looking for latest Chrome and Fire fox browsers implementation.
<video width="320" height="240" controls="true">
<source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
So I have a music which only plays automatically on edge chromium. On firefox and chrome, it doesn't work. Any solution? THANKS
<audio id="music" autoplay loop style="display:none">
<source src="Music1.mp3" type="audio/mp3">
<source src="Msic1.ogg" type="audio/ogg">
</audio>
visit this
i think you should use iframe and audio tag as well for non-chrome browsers.
Try this, it worked for me. Just need to add the preload attribute.
Keep in mind the user must interact with the domain, so click something in any page of the site, once he interacts everything should work fine.
<audio id="music" autoplay loop preload>
<source src="Music1.mp3" type="audio/mp3">
<source src="Msic1.ogg" type="audio/ogg">
</audio>
I am trying to use a video with sound in the video tag but the sound is not playing when I run it in browser ,if I remove the muted attribute video doesn't play .The video directly works in browser if you open the link.Please help
<div class="background-wrap">
<video preload="auto" autoplay="true" loop="loop" muted>
<source src=http://techslides.com/demos/sample-videos/small.mp4 type="video/mp4"> </video>
</div>
I almost made it so I can have background music but when I go to my localhost it just downloads the music instead of playing it but in the full path one it plays it in the background so how can I prevent this from happening so it won't download in localhost?
Here is the code for it and the file name is actually "Sound.mp3" as well.
<embed src="Sound.mp3" autostart="true" loop="true"width="2" height="0" controls>
Any ideas of what do add to make it just play and not download?
I am actually working on a page that looks pretty cool and wanted to add background music cause it is actually an "under construction" page and wanted to make it look cooler with background music.
The prefered way of adding audio in Html5 is to use the audio element.You can achieve them by using the following codes,
This code will play the Sound.mp3 file with the controllers displayed for the user. So the users can control the background music. With the autoplay attribute, the music will start automatically.
<audio controls="controls" autoplay="autoplay"><source src="Sound.mp3" type="audio/mpeg" /></audio>
If you don't wanna show the controls, you can simply remove the controls attribute. As follows,
<audio autoplay="autoplay"><source src="Sound.mp3" type="audio/mpeg" /></audio>
But the song will autoplay because the autoplay attribute is added.
Unfortunately, not all browsers support mp3, so it's a good idea to include multiple versions of the file in different formats. As follows,
<audio autoplay="autoplay">
<source src="Sound.mp3" type="audio/mpeg" />
<source src="Sound.wav" type="audio/wav" />
<source src="Sound.ogg" type="audio/ogg" />
<p>This content is displayed by browsers that don't recognize the audio element.</p>
</audio>
Hope it helped. Good luck with your project. :)
More Attributes
loop - Automatically loop (keep playing over and over).
Use Tag to attach the attach the audio file to the html file.
If your audio file is Sound.mp3 then include it in <audio> tag.
<audio controls>
<source src="Sound.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
or use the below code
<audio src="Sound.mp3"> </audio>
Is it possible play video from remote download video link.
For example I have link http://vidrack-media.s3.amazonaws.com/student_47e96b83-989e-437a-8953-0d068308e25f.mp4
I wanna render any video player where I can watch this video.
Yes you can, in nearly every player.
<video width="320" height="240" controls>
<source src="http://vidrack-media.s3.amazonaws.com/student_47e96b83-989e-437a-8953-0d068308e25f.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>