Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9106461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:20:49+00:00 2026-06-17T02:20:49+00:00

I know that you can’t alter (or mute) the volume of HTML5 audio elements

  • 0

I know that you can’t alter (or mute) the volume of HTML5 audio elements in iOS so I’m looking for a way to test for this (so that I can remove UI elements related to the volume).

After reading:

http://developer.apple.com/library/safari/#documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW10

Specifically:

“On iOS devices, the audio level is always under the user’s physical control. The volume property is not settable in JavaScript. Reading the volume property always returns 1.”

I figured that I could create a new Audio object, attempt to change the volume to something other than 1 and then test the volume. i.e. :

var isIOS = false; 
var test = new Audio(); 
test.volume = 0.5; 
if (test.volume === 1) { 
    isIOS = true; 
} 

I was just wondering if anyone knew of any possible problems with this, and/or had a better solution. Is there a chance of false positives?

Additionally, does anyone know of any other devices that don’t allow volume changes but that don’t implement it in this way?

cheers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:20:51+00:00Added an answer on June 17, 2026 at 2:20 am

    Ok, so I’ve tested this on a handful of devices and emulators, and it seems solid enough. The only danger I can see is that there exists (now or in the future) some other device which doesn’t allow such volume changes, but that implements that restriction in some other way.
    It’d be great if anyone can let me know if they come across this.
    cheers.

    EDIT: For the record, im now using this: http://mobiledetect.net/ and just turning off the volume UI elements for all mobile devices. It seemed like more devices were making restrictions on audio, and given the ease with which the volume can be altered via physical buttons, and the restricted screen space, it seemed best to just turn off the volume UI elements for all mobile devices.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that I can track when the mouse is moved like this: $(body).mousemove(
I know that soap can send XML over http, is there any way to
I know that from iOS 4.0 onwards we can execute our code in background.
I know that I can run Perl on Android, but I'm looking to write
I already know that there are flash and html5 players that can effectively stream
I know that can't use left join in indexed view. but I don't understand
I know that can co-exists with web form no problem as Hanselman mention here
I know that it's a subject that can raise a lot of debate, but
I just want to know that can i make an application which have some
I want to know that can mouse click event detects colors or even strings.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.