Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

fireshot91

macrumors 601
Original poster
Jul 31, 2008
4,721
1
Northern VA
Firstly, I have no idea if this is the correct section or not. If it isn't, my apologies.


Now, I've put in an HTML5 video on a webpage, but I want to have it be muted on load, yet playing. As part of the video tag, I've tried <video audio="muted">, but that doesn't seem to actually do anything.. I've also tried audio="0", audio=0, audio="", etc. Nothing seems to work.


Any help?
 
So how did you try it exactly ? They even provide an example :

The muted attribute on the video element is a boolean attribute that controls the default state of the audio channel of the media resource, potentially overriding user preferences.

When a media element is created, if it has a muted attribute specified, the user agent must set the muted IDL attribute to true, overriding any user preference.

The defaultMuted IDL attribute must reflect the muted content attribute.

This attribute has no dynamic effect (it only controls the default state of the element).

This video (an advertisment) autoplays, but to avoid annoying users, it does so without sound, and allows the user to turn the sound on.

<video src="adverts.cgi?kind=video" controls autoplay loop muted></video>
 
So how did you try it exactly ? They even provide an example :

This is the exact HTML code.

<video id="video" width="100%" height="100%" autoplay="" controls="" audio="muted" muted>

Neither the audio="muted", nor just the muted, do anything..it still plays with full volume. The src of the video is inside the two video tags.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.