[whatwg] audio and video: volume and muted as content attributes?
philipj at opera.com
Mon May 31 22:53:03 PDT 2010
On Mon, 31 May 2010 19:33:45 +0800, Silvia Pfeiffer
<silviapfeiffer1 at gmail.com> wrote:
> I just came across a curious situation in the spec: IIUC, it seems the
> @volume and @muted attributes are only IDL attributes and not content
> attributes. This means that an author who is creating an audio-visual
> their media elements or mute them rather than just being able to
> specify this through content attributes.
> I've searched the archives and didn't find a discussion or reasons for
> this. Apologies if this has been discussed before.
> I am guessing the reasons for not having them as content attributes is
> that anything that requires muting of audio-visual content is assumed
> However, if I have multiple videos on a page, all on autoplay, it
> With all the new CSS3 functionality, I can, for example, build a
> spinning cube of video elements that are on autoplay or a marquee of
> videos on autoplay - all of which would require muting the videos to
> be bearable. If we added @muted to the content attributes, it would be
> As for the @volume attribute, I think it would be similarly useful if
> an author could control the loudness at which a video or audio file
> starts playing back, in particular if he/she knows it is actually a
> fairly loud/quiet file.
> I'm curious about other people's opinions.
I think both volume and muted could have some use as content attributes,
so the question is only if the additional complexity for implementations
and authors. muted is a boolean attribute and would be trivial to support.
volume, however, is a float and last I checked Opera doesn't reflect 
any other float properties. I wouldn't be surprised if it would be a first
for some other browsers too. Reflecting floats is a little bit annoying (I
tried when the spec had an aspect attribute for video) because of having
to decide an arbitrary precision to which to round. That absence of volume
should imply 1.0 (and not 0.0 or NaN) could also be a little bit of a
So, I am neither in favor or against of reflecting volume and mute as
content attributes. Implementation is quite simple, but doesn't come for
free unless browsers are already reflecting other float properties.
More information about the whatwg