[whatwg] audio and video: volume and muted as content attributes?

Hi,

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
Webpage has to use JavaScript to turn down (or up) the loudness of
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
to need JavaScript anyway.

However, if I have multiple videos on a page, all on autoplay, it
would be nice to turn off the sound of all of them without JavaScript.
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
easy to set the muted state without having to write any JavaScript.

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.

Cheers,
Silvia.

Received on Monday, 31 May 2010 04:33:45 UTC