Solved

Mute video in iOS

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

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.
Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

810 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