iOS prevents changes to volume
property of <audio>
and <video>
elements
When creating custom interfaces around the HTML5 <audio>
and <video>
elements, make sure you hide the volume control if the user is on iOS. According to Apple's documentation, the volume
property of <audio>
and <video>
elements is read-only, and always returns 1:
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.
— iOS-Specific Considerations for Safari HTML5 audio and video, under the "Volume Control in JavaScript" section.
Published: August 18, 2021 at 12:11 AM