Solved

Mute video in iOS

Posted on 2013-01-03
1
1,357 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
un1x86 earned 500 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
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…

690 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