Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does HTML 5 Audio disregards mobile device audio settings such as silent or volume?

I have a site that targets mobile android users. I’m using the HTML5 audio to play background music.

The audio is played even if the device is on silent; also the audio is played in the highest volume regardless of the device volume settings.

Does anyone know why these things happen or how to get the device current audio settings? I’d prefer a client side (javascript) solution but I’m open to all solution.

Thank you for your help Moshe S.

like image 275
Moshe S Avatar asked Jan 01 '13 12:01

Moshe S


People also ask

How to embed a sound in HTML?

How to embed audio in HTML? To embed audio in HTML, we use the <audio> tag.

How to make an audio player in HTML?

To create the player we will add a <div> width the class “audio-player”. This div will be the container for our player elements. Let's add a <h1> tag for the song title and <img> for the cover. Then we will add the <audio> tag that will link to our song and we'll also set the id to “audio-player”.

How to embed audio in Webpage?

An easy way to embed audio on a website is by using a sound hosting site, such as SoundCloud or Mixcloud. All you need to do is upload the file and receive an HTML embed code. Then copy and paste the embed code into the web page's code or WYSIWYG site editor. This works for most CMS platforms and website builders.

What will be displayed if browser doesn't support audio tag?

If the browser doesn't support the audio element, then it will display the message, “Sorry, but your browser doesn't support audio.”


1 Answers

In Android, even if the phone is on silent, the media volume will not change.

I'm not sure if android allows for the modification of the system sound settings through the browser, since the default one does not have permission to change/read the volume state.

like image 194
SeinopSys Avatar answered Nov 15 '22 13:11

SeinopSys