Solved

Mute video in iOS

Posted on 2013-01-03
1
1,163 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:
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Read about why website design really matters in today's demanding market.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
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:

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now