?
Solved

Mute video in iOS

Posted on 2013-01-03
1
Medium Priority
?
1,518 Views
Last Modified: 2013-01-04
Dear Experts,

I have created custom video player using javascript. How to mute video in iOS using javascript? Below is my code:

var myAudio = document.getElementById('myaudio');

if (myAudio.muted==true) {
myAudio.volume = 1;
myAudio.muted = false;
} else {
myAudio.volume = 0;
myAudio.muted = true;
}

Above code working fine in Windows, MAC and Linux. But not working in iOS.

Regards,
John.A
0
Comment
Question by:JohnLourdu
1 Comment
 
LVL 11

Accepted Solution

by:
Chris Sandrini earned 1500 total points
ID: 38742915
I think you can not as Apple doesn't follow the standards there. They want to controll it over the hardware mute button.

See http://blog.millermedeiros.com/unsolved-html5-video-issues-on-ios/


No way to control volume using JavaScript

The HTML5 spec says that every media element have a property called volume which is used to get and set the volume of the audio or video playback, this value should be a number from 0.0 to 1.0 (inclusive), but again Apple decided to not follow the standard on the iOS and only allow the volume control using the physical control [3]. Changing the property muted also doesn’t have any effect on the iOS.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question