Disable second audio player when the other is playing in chrome - javascript

I have two audio files on the page and I would want the user to listen to just one audio at once while disabling the other. I think some kind of javascript needs to be inserted.
<audio controls="" controlsList="nodownload">
<source src="audio/audio1.mp3"
type="audio/mpeg">
Your browser does not support the
audio element. </audio>
<audio controls="" controlsList="nodownload">
<source src="audio/audio2.mp3"
type="audio/mpeg">
Your browser does not support the
audio element. </audio>
Thanks in advance

Related

Video and Audio automatically starts downloading in html5

I am new to web programming. I have a question. why do the audio and videos from the background start downloading automatically(download dialog pops up from IDM) when my index.html page opens? I am using Aframe's videosphere in the background.
<video id="video2" loop="true" autoplay src="/vid/waterfall.mp4"></video>
<a-videosphere id="video-360" src="#video2"></a-videosphere>
Thank you.
This May Help You. preload='none' prevent pre download
<video preload='none'
id="video2"
loop="true"
autoplay src="/vid/waterfall.mp4">
</video>
<a-videosphere
id="video-360" src="#video2">
For Audio
<audio preload="none">
<source src="audio.mp3" type="audio/mpeg" />
Audio Type
</audio>

Auto play problem while using chrome HTML

I have a problem with google chrome while playing this code. The audio file isn't working because of the new policy of chrome
<audio autoplay loop>
<source src="Test.mp3" type="audio/mpeg">

How to pause audio tag when screen off or start second one

I'm trying to pause audio when mobile screen off or run a second audio tag.
this is sample example of my html code
<audio controls>
<source src="audio1.mp3">
Does not support the audio element.
</audio>
<audio controls>
<source src="audio2.mp3">
Does not support the audio element.
</audio>
Unfortunately I don't know how can I make EventListener to check the above cases.

How to pause/mute S3 video which is embedded in an iframe?

We are hosting a careersites for customers, one of our customers provided the data which contains video from S3 which is embedded in an iframe.
Problem is the video is getting played automatically when page is loaded. Customer is asking to pause or mute the video on page load.
Is there any way we can pause the video?
Unless there is a special reason you need to use an iframe, the usual way to handle video now is with the HTML5 video tag.
This has an attribute 'autoplay' which if present will start the video automatically, and if absent will not start the video:
http://www.w3schools.com/tags/att_video_autoplay.asp
The following will autoplay (if the devices supports this - some mobile device do not to save on data charges):
<video controls autoplay>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
and this will not:
<video controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>

Make an html5 audio playlist that automatically plays one song after the next

I would like to setup an HTML5 audio playlist that automatically plays one song after the next. Here is my start point:
<audio controls>
<source src="example.mp3" type="audio/mpeg">
<source src="example.mp3" type="audio/mpeg">
<source src="example.mp3" type="audio/mpeg">
<source src="example.mp3" type="audio/mpeg">
<source src="example.mp3" type="audio/mpeg">
</audio>
What is the basic way to make this happen using JavaScript?
I am not sure what exactly you are trying to do. But, you should look into this jQuery plugin.. They have very good tutorials on their home page.
http://mediaelementjs.com/
If you would like more player.
http://www.narga.net/awesome-jquery-audio-video-player-plugins/
or google : jQuery audio players

Categories