Re: [whatwg] audio and video: volume and muted as content attributes?
On Thu, 2010-06-10 at 12:32 +1000, Silvia Pfeiffer wrote: > On Thu, Jun 10, 2010 at 12:13 PM, Ashley Sheridan > wrote: > > > On Thu, 2010-06-10 at 12:03 +1000, Silvia Pfeiffer wrote: > > > On Thu, Jun 10, 2010 at 11:55 AM, Ashley Sheridan > > wrote: > > > > > > On Thu, 2010-06-10 at 11:52 +1000, Silvia Pfeiffer > > wrote: > > > > > I don't think that is possible in the way that the volume > attribute is > > > currently defined as a value between [0;1]. That is an > orthogonal, but > > > still important question about the volume attribute then. > > > > > > So, if you say 300%, I assume you mean 3 times louder > than what the > > > track is given as? I do wonder how to do that with the > current volume > > > attribute - right now the spec says that the default > value set is 1.0 > > > [1]. It seems that means we cannot amplify a quiet audio > track but > > > have to rely on the user to turn up the volume on their > computer? I > > > would actually prefer if the default setting was > something like 0.5 > > > and we could then turn the volume up or down in > javascript or > > > preferably event through a content attribute as mentioned. > > > > > > Cheers, > > > Silvia. > > > > > > [1] > http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-volume > > > > > > > > > On Thu, Jun 10, 2010 at 10:05 AM, Kevin Marks > wrote: > > > > Setting volume above 1.0 can be very useful if the > original is too quiet. > > > > For example, Quicktime allows a volume of 300% to > amplify quiet tracks > > > > > > > > On May 31, 2010 11:30 PM, "Philip Jägenstedt" > wrote: > > > > > > > > On Tue, 01 Jun 2010 14:17:03 +0800, Silvia Pfeiffer > > > > wrote: > > > > > > > >> On Tue, Ju... > > > > > > > > This would make volume even more special, as a float > that reflects as an > > > > integer percentage. Just using the existing definition > for reflecting a > > > > float would be simpler. > > > > > > > >>> So, I am neither in favor or against of reflecting > volume and mute as > > > >>> content attributes. Im... > > > > > > > > I'd be fine with reflecting muted if many people think > it would be useful. > > > > I'm not the one to make that judgment though. > > > > > > > > Volume isn't a huge problem, just not as trivial as one > might suspect. > > > > Another thing to consider is that it is currently > impossible to set volume > > > > to a value outside the range [0,1] via the DOM API. > With a content > > > > attribute, volume="-1" and volume="1.1" would need to > be handled too. I'd > > > > prefer it being ignored rather than being clamped. > > > > > > > >>> [1] > > > >>> > > > >>> > http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect > > > >> > > > >> > > > >> > > > >> Ch... > > > > > > > > -- > > > > Philip Jägenstedt > > > > Core Developer > > > > Opera Software > > > > > > > > Or you could just raise the volume of the audio > > track itself. I think being able to raise the volume > > like this (beyond 100% of what it is) with script > > just makes it something more likely to be abused > > (think how the TV adverts always seem twice as loud > > as the programs they surround) and so will end up > > getting blocked more often. > > > > > > > > > > > > > > That requires editing the resource. Think about it from a > > process point-of-view: you're a Web developer and have been > > given a set of media resources to put on a Website. As you > > put it all together, you notice that the volume of the > > different files is different and thus playing them back next > > to each other will create a very confusing user experience. >
Re: [whatwg] audio and video: volume and muted as content attributes?
On Thu, Jun 10, 2010 at 12:13 PM, Ashley Sheridan wrote: > On Thu, 2010-06-10 at 12:03 +1000, Silvia Pfeiffer wrote: > > On Thu, Jun 10, 2010 at 11:55 AM, Ashley Sheridan < > a...@ashleysheridan.co.uk> wrote: > > > On Thu, 2010-06-10 at 11:52 +1000, Silvia Pfeiffer wrote: > > I don't think that is possible in the way that the volume attribute is > currently defined as a value between [0;1]. That is an orthogonal, but > still important question about the volume attribute then. > > So, if you say 300%, I assume you mean 3 times louder than what the > track is given as? I do wonder how to do that with the current volume > attribute - right now the spec says that the default value set is 1.0 > [1]. It seems that means we cannot amplify a quiet audio track but > have to rely on the user to turn up the volume on their computer? I > would actually prefer if the default setting was something like 0.5 > and we could then turn the volume up or down in javascript or > preferably event through a content attribute as mentioned. > > Cheers, > Silvia. > > [1] > http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-volume > > > On Thu, Jun 10, 2010 at 10:05 AM, Kevin Marks wrote: > > Setting volume above 1.0 can be very useful if the original is too quiet. > > For example, Quicktime allows a volume of 300% to amplify quiet tracks > > > > On May 31, 2010 11:30 PM, "Philip Jägenstedt" wrote: > > > > On Tue, 01 Jun 2010 14:17:03 +0800, Silvia Pfeiffer > > wrote: > > > >> On Tue, Ju... > > > > This would make volume even more special, as a float that reflects as an > > integer percentage. Just using the existing definition for reflecting a > > float would be simpler. > > > >>> So, I am neither in favor or against of reflecting volume and mute as > >>> content attributes. Im... > > > > I'd be fine with reflecting muted if many people think it would be useful. > > I'm not the one to make that judgment though. > > > > Volume isn't a huge problem, just not as trivial as one might suspect. > > Another thing to consider is that it is currently impossible to set volume > > to a value outside the range [0,1] via the DOM API. With a content > > attribute, volume="-1" and volume="1.1" would need to be handled too. I'd > > prefer it being ignored rather than being clamped. > > > >>> [1] > >>> > >>> http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect > >> > >> > >> > >> Ch... > > > > -- > > Philip Jägenstedt > > Core Developer > > Opera Software > > > > Or you could just raise the volume of the audio track itself. I think > being able to raise the volume like this (beyond 100% of what it is) with > script just makes it something more likely to be abused (think how the TV > adverts always seem twice as loud as the programs they surround) and so will > end up getting blocked more often. > > > > > That requires editing the resource. Think about it from a process > point-of-view: you're a Web developer and have been given a set of media > resources to put on a Website. As you put it all together, you notice that > the volume of the different files is different and thus playing them back > next to each other will create a very confusing user experience. Do you > really want to shoot the files back to the production to adjust the volume > settings so they are all similar? If you're under time pressure, you'd > probably much prefer just setting a volume attribute on each so they all > play back with the same level. > > > > Your example of TV ads being louder than the rest of the program is > indeed a production issue but would not replicable through a volume setting > for the resource, since that volume applies to the whole resource and not > just to the ad clip inside it. I don't think that kind of abuse would > originate from JavaScript - it already originates from production and > doesn't really apply to this issue. > > > > Cheers, > > Silvia. > > > > > If, like you mentioned in your example, all the media files are of > different volumes, then your script would have to somehow detect the actual > real volume of them in order to give the right level of adjustment for > normalisation, something which I don't believe is possible just at the > moment. > It is possible, but not necessary. You can just make some changes yourself - after all, it's only done once, since the resources won't change. > If I was in such a situation, yes I would most likely send them back to the > post production team, or at the very least normalise them myself with ffmpeg > or some similar tool. > Yes, sure you can. But should it be the only possibility? > It would be like sourcing a bunch of images for a website and using canvas > to applying a filter to adjust the light volumes of them all. Sure, it might > be possible, but the images really should have been adjusted before they > were used on the site. Why should we encourage sloppy content producers? > If you get the videos from different
Re: [whatwg] audio and video: volume and muted as content attributes?
On Thu, 2010-06-10 at 12:03 +1000, Silvia Pfeiffer wrote: > On Thu, Jun 10, 2010 at 11:55 AM, Ashley Sheridan > wrote: > > > On Thu, 2010-06-10 at 11:52 +1000, Silvia Pfeiffer wrote: > > > I don't think that is possible in the way that the volume attribute > is > > currently defined as a value between [0;1]. That is an orthogonal, > but > > still important question about the volume attribute then. > > > > So, if you say 300%, I assume you mean 3 times louder than what the > > track is given as? I do wonder how to do that with the current > volume > > attribute - right now the spec says that the default value set is > 1.0 > > [1]. It seems that means we cannot amplify a quiet audio track but > > have to rely on the user to turn up the volume on their computer? I > > would actually prefer if the default setting was something like 0.5 > > and we could then turn the volume up or down in javascript or > > preferably event through a content attribute as mentioned. > > > > Cheers, > > Silvia. > > > > [1] > http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-volume > > > > > > On Thu, Jun 10, 2010 at 10:05 AM, Kevin Marks > wrote: > > > Setting volume above 1.0 can be very useful if the original is > too quiet. > > > For example, Quicktime allows a volume of 300% to amplify quiet > tracks > > > > > > On May 31, 2010 11:30 PM, "Philip Jägenstedt" > wrote: > > > > > > On Tue, 01 Jun 2010 14:17:03 +0800, Silvia Pfeiffer > > > wrote: > > > > > >> On Tue, Ju... > > > > > > This would make volume even more special, as a float that > reflects as an > > > integer percentage. Just using the existing definition for > reflecting a > > > float would be simpler. > > > > > >>> So, I am neither in favor or against of reflecting volume and > mute as > > >>> content attributes. Im... > > > > > > I'd be fine with reflecting muted if many people think it would > be useful. > > > I'm not the one to make that judgment though. > > > > > > Volume isn't a huge problem, just not as trivial as one might > suspect. > > > Another thing to consider is that it is currently impossible to > set volume > > > to a value outside the range [0,1] via the DOM API. With a content > > > attribute, volume="-1" and volume="1.1" would need to be handled > too. I'd > > > prefer it being ignored rather than being clamped. > > > > > >>> [1] > > >>> > > >>> > http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect > > >> > > >> > > >> > > >> Ch... > > > > > > -- > > > Philip Jägenstedt > > > Core Developer > > > Opera Software > > > > > Or you could just raise the volume of the audio track itself. > I think being able to raise the volume like this (beyond 100% > of what it is) with script just makes it something more likely > to be abused (think how the TV adverts always seem twice as > loud as the programs they surround) and so will end up getting > blocked more often. > > > > > > > That requires editing the resource. Think about it from a process > point-of-view: you're a Web developer and have been given a set of > media resources to put on a Website. As you put it all together, you > notice that the volume of the different files is different and thus > playing them back next to each other will create a very confusing user > experience. Do you really want to shoot the files back to the > production to adjust the volume settings so they are all similar? If > you're under time pressure, you'd probably much prefer just setting a > volume attribute on each so they all play back with the same level. > > > Your example of TV ads being louder than the rest of the program is > indeed a production issue but would not replicable through a volume > setting for the resource, since that volume applies to the whole > resource and not just to the ad clip inside it. I don't think that > kind of abuse would originate from JavaScript - it already originates > from production and doesn't really apply to this issue. > > > Cheers, > Silvia. > > If, like you mentioned in your example, all the media files are of different volumes, then your script would have to somehow detect the actual real volume of them in order to give the right level of adjustment for normalisation, something which I don't believe is possible just at the moment. If I was in such a situation, yes I would most likely send them bac
Re: [whatwg] audio and video: volume and muted as content attributes?
On Thu, Jun 10, 2010 at 11:55 AM, Ashley Sheridan wrote: > On Thu, 2010-06-10 at 11:52 +1000, Silvia Pfeiffer wrote: > > I don't think that is possible in the way that the volume attribute is > currently defined as a value between [0;1]. That is an orthogonal, but > still important question about the volume attribute then. > > So, if you say 300%, I assume you mean 3 times louder than what the > track is given as? I do wonder how to do that with the current volume > attribute - right now the spec says that the default value set is 1.0 > [1]. It seems that means we cannot amplify a quiet audio track but > have to rely on the user to turn up the volume on their computer? I > would actually prefer if the default setting was something like 0.5 > and we could then turn the volume up or down in javascript or > preferably event through a content attribute as mentioned. > > Cheers, > Silvia. > > [1] > http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-volume > > > On Thu, Jun 10, 2010 at 10:05 AM, Kevin Marks wrote: > > Setting volume above 1.0 can be very useful if the original is too quiet. > > For example, Quicktime allows a volume of 300% to amplify quiet tracks > > > > On May 31, 2010 11:30 PM, "Philip Jägenstedt" wrote: > > > > On Tue, 01 Jun 2010 14:17:03 +0800, Silvia Pfeiffer > > wrote: > > > >> On Tue, Ju... > > > > This would make volume even more special, as a float that reflects as an > > integer percentage. Just using the existing definition for reflecting a > > float would be simpler. > > > >>> So, I am neither in favor or against of reflecting volume and mute as > >>> content attributes. Im... > > > > I'd be fine with reflecting muted if many people think it would be useful. > > I'm not the one to make that judgment though. > > > > Volume isn't a huge problem, just not as trivial as one might suspect. > > Another thing to consider is that it is currently impossible to set volume > > to a value outside the range [0,1] via the DOM API. With a content > > attribute, volume="-1" and volume="1.1" would need to be handled too. I'd > > prefer it being ignored rather than being clamped. > > > >>> [1] > >>> > >>> http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect > >> > >> > >> > >> Ch... > > > > -- > > Philip Jägenstedt > > Core Developer > > Opera Software > > > Or you could just raise the volume of the audio track itself. I think being > able to raise the volume like this (beyond 100% of what it is) with script > just makes it something more likely to be abused (think how the TV adverts > always seem twice as loud as the programs they surround) and so will end up > getting blocked more often. > > That requires editing the resource. Think about it from a process point-of-view: you're a Web developer and have been given a set of media resources to put on a Website. As you put it all together, you notice that the volume of the different files is different and thus playing them back next to each other will create a very confusing user experience. Do you really want to shoot the files back to the production to adjust the volume settings so they are all similar? If you're under time pressure, you'd probably much prefer just setting a volume attribute on each so they all play back with the same level. Your example of TV ads being louder than the rest of the program is indeed a production issue but would not replicable through a volume setting for the resource, since that volume applies to the whole resource and not just to the ad clip inside it. I don't think that kind of abuse would originate from JavaScript - it already originates from production and doesn't really apply to this issue. Cheers, Silvia.
Re: [whatwg] audio and video: volume and muted as content attributes?
On Thu, 2010-06-10 at 11:52 +1000, Silvia Pfeiffer wrote: > I don't think that is possible in the way that the volume attribute is > currently defined as a value between [0;1]. That is an orthogonal, but > still important question about the volume attribute then. > > So, if you say 300%, I assume you mean 3 times louder than what the > track is given as? I do wonder how to do that with the current volume > attribute - right now the spec says that the default value set is 1.0 > [1]. It seems that means we cannot amplify a quiet audio track but > have to rely on the user to turn up the volume on their computer? I > would actually prefer if the default setting was something like 0.5 > and we could then turn the volume up or down in javascript or > preferably event through a content attribute as mentioned. > > Cheers, > Silvia. > > [1] > http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-volume > > > On Thu, Jun 10, 2010 at 10:05 AM, Kevin Marks wrote: > > Setting volume above 1.0 can be very useful if the original is too quiet. > > For example, Quicktime allows a volume of 300% to amplify quiet tracks > > > > On May 31, 2010 11:30 PM, "Philip Jägenstedt" wrote: > > > > On Tue, 01 Jun 2010 14:17:03 +0800, Silvia Pfeiffer > > wrote: > > > >> On Tue, Ju... > > > > This would make volume even more special, as a float that reflects as an > > integer percentage. Just using the existing definition for reflecting a > > float would be simpler. > > > >>> So, I am neither in favor or against of reflecting volume and mute as > >>> content attributes. Im... > > > > I'd be fine with reflecting muted if many people think it would be useful. > > I'm not the one to make that judgment though. > > > > Volume isn't a huge problem, just not as trivial as one might suspect. > > Another thing to consider is that it is currently impossible to set volume > > to a value outside the range [0,1] via the DOM API. With a content > > attribute, volume="-1" and volume="1.1" would need to be handled too. I'd > > prefer it being ignored rather than being clamped. > > > >>> [1] > >>> > >>> http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect > >> > >> > >> > >> Ch... > > > > -- > > Philip Jägenstedt > > Core Developer > > Opera Software Or you could just raise the volume of the audio track itself. I think being able to raise the volume like this (beyond 100% of what it is) with script just makes it something more likely to be abused (think how the TV adverts always seem twice as loud as the programs they surround) and so will end up getting blocked more often. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [whatwg] audio and video: volume and muted as content attributes?
I don't think that is possible in the way that the volume attribute is currently defined as a value between [0;1]. That is an orthogonal, but still important question about the volume attribute then. So, if you say 300%, I assume you mean 3 times louder than what the track is given as? I do wonder how to do that with the current volume attribute - right now the spec says that the default value set is 1.0 [1]. It seems that means we cannot amplify a quiet audio track but have to rely on the user to turn up the volume on their computer? I would actually prefer if the default setting was something like 0.5 and we could then turn the volume up or down in javascript or preferably event through a content attribute as mentioned. Cheers, Silvia. [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-volume On Thu, Jun 10, 2010 at 10:05 AM, Kevin Marks wrote: > Setting volume above 1.0 can be very useful if the original is too quiet. > For example, Quicktime allows a volume of 300% to amplify quiet tracks > > On May 31, 2010 11:30 PM, "Philip Jägenstedt" wrote: > > On Tue, 01 Jun 2010 14:17:03 +0800, Silvia Pfeiffer > wrote: > >> On Tue, Ju... > > This would make volume even more special, as a float that reflects as an > integer percentage. Just using the existing definition for reflecting a > float would be simpler. > >>> So, I am neither in favor or against of reflecting volume and mute as >>> content attributes. Im... > > I'd be fine with reflecting muted if many people think it would be useful. > I'm not the one to make that judgment though. > > Volume isn't a huge problem, just not as trivial as one might suspect. > Another thing to consider is that it is currently impossible to set volume > to a value outside the range [0,1] via the DOM API. With a content > attribute, volume="-1" and volume="1.1" would need to be handled too. I'd > prefer it being ignored rather than being clamped. > >>> [1] >>> >>> http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect >> >> >> >> Ch... > > -- > Philip Jägenstedt > Core Developer > Opera Software
Re: [whatwg] audio and video: volume and muted as content attributes?
Setting volume above 1.0 can be very useful if the original is too quiet. For example, Quicktime allows a volume of 300% to amplify quiet tracks On May 31, 2010 11:30 PM, "Philip Jägenstedt" wrote: On Tue, 01 Jun 2010 14:17:03 +0800, Silvia Pfeiffer < silviapfeiff...@gmail.com> wrote: > On Tue, Ju... This would make volume even more special, as a float that reflects as an integer percentage. Just using the existing definition for reflecting a float would be simpler. >> So, I am neither in favor or against of reflecting volume and mute as >> content attributes. Im... I'd be fine with reflecting muted if many people think it would be useful. I'm not the one to make that judgment though. Volume isn't a huge problem, just not as trivial as one might suspect. Another thing to consider is that it is currently impossible to set volume to a value outside the range [0,1] via the DOM API. With a content attribute, volume="-1" and volume="1.1" would need to be handled too. I'd prefer it being ignored rather than being clamped. >> [1] >> http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect > > > > Ch... -- Philip Jägenstedt Core Developer Opera Software
Re: [whatwg] audio and video: volume and muted as content attributes?
References: <4c0420c9.d345d80a.5c04.d...@mx.google.com> >Bjartur Thorlacius wrote: >> Play-during can stop, autoplay and repeat sounds. >> It's not obvious to me how this will apply to elements that represent >> audiovisual content but volume: silent; unambiguously mutes content. >> Decorating audio (such as background music in games or videos) >> seem to be even more easily styled for some reason. Multiple >> soundtracks can be muxed and assigned different loudness. >> Also @media aural {display: none;} can be used on audio elements >> but I haven't read the specs properly so I don't know if that would hide >> an element when inside of an @media aural clause. >> >> CSS 3 aural has still to be done so more capabilities may be suggested. >> >Has there been any discussion about implementing support for CSS2 >aural in Web browsers? Until such a time - and in fact independently >of that - I still think turning the existing volume and muted IDL >attributes into content attributes would be a nice and simple >solution. Introducing a whole CSS aural control section will take lots >longer IMHO. Also, it won't hurt to have both - we do that for width >and height, too. It seems much more "The Right Way"(tm) to do such things in CSS. Browsers don't have to conform to the whole aural specification nor the speech module of CSS 3. I think CSS 3 will have seperate speech and aural modules which would solve the problem entirely. Note also that CSS 2 aural allows styling of cues. As there's a workaround implementation time isn't the number one priority. There's need for the capability so saying that it shouldn't be implemented because of lack of discussion seems weird. Lachlan Hunt wrote: >On 2010-06-01 13:09, Bjartur Thorlacius wrote: >> On 5/31/10, Silvia Pfeiffer wrote: >>> I am not aware of a CSS property for media elements that lets you >>> control the muted state. Can you link me to a specification? >> >> Well, http://www.w3.org/TR/CSS2/aural.html defines volume and >> play-during. Play-during can stop, autoplay and repeat sounds. >> It's not obvious to me how this will apply to elements that represent >> audiovisual content but volume: silent; unambiguously mutes content. > >Those properties were designed for aural browsers using speech synthesis >to read the content of a page, not to control multimedia in a page >itself. Well, sounds are to speech/text as images are to (written) text. You can float both paragraphs and images because to CSS they're just boxes. I don't see a reason not to allow authors to control the volume of sound if they can do so with speech. As for play-during it's so general that it might be included in interactive visual media as well. >Also, attempting to hijack those properties for use with >multimedia content could create difficulties as you would have to define >how the HTMLMediaElement's volume and muted properties interact with >those CSS properties, if at all. How's it done for other visual/behavioral content attributes in HTML? Align, color and in fact most of the attributes of have similiar problems.
Re: [whatwg] audio and video: volume and muted as content attributes?
On 6/1/10 7:09 AM, Bjartur Thorlacius wrote: Also @media aural {display: none;} can be used on audio elements but I haven't read the specs properly so I don't know if that would hide an element when inside of an @media aural clause. You seem to be somewhat confused about the way "media" are used in CSS. A "medium" is a property of the way the entire document is being presented. Typical values one runs into with desktop web browsers are "screen" and "print". The spec you link to is for the "aural" and "speech" media. So in particular, rules inside "@media aural {}" will get ignored in all desktop browsers. (Your example has a declaration directly inside @media, which is just a parse error, but I assume you meant putting an actual rule that assigns display:none to a particular element in the @media rule). But more to the point, since the aural properties only apply to "aural" and "speech" media it would require a pretty major CSS spec change to make them mean anything in the "screen" medium, which is what you're proposing. -Boris
Re: [whatwg] audio and video: volume and muted as content attributes?
On 2010-06-01 13:09, Bjartur Thorlacius wrote: On 5/31/10, Silvia Pfeiffer wrote: I am not aware of a CSS property for media elements that lets you control the muted state. Can you link me to a specification? Well, http://www.w3.org/TR/CSS2/aural.html defines volume and play-during. Play-during can stop, autoplay and repeat sounds. It's not obvious to me how this will apply to elements that represent audiovisual content but volume: silent; unambiguously mutes content. Those properties were designed for aural browsers using speech synthesis to read the content of a page, not to control multimedia in a page itself. Also, attempting to hijack those properties for use with multimedia content could create difficulties as you would have to define how the HTMLMediaElement's volume and muted properties interact with those CSS properties, if at all. -- Lachlan Hunt - Opera Software http://lachy.id.au/ http://www.opera.com/
Re: [whatwg] audio and video: volume and muted as content attributes?
On Tue, Jun 1, 2010 at 9:09 PM, Bjartur Thorlacius wrote: > On 5/31/10, Silvia Pfeiffer wrote: >> On Tue, Jun 1, 2010 at 6:48 AM, bjartur 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 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. If you want to control the volume for the user after the page loads then yes, you'll need JavaScript. 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. >>> >>> Exactly. >>> 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. >>> >>> If you need the audio to be muted you should use CSS. If you need to >>> control volume dynamically you need scripting. >> >> I am not aware of a CSS property for media elements that lets you >> control the muted state. Can you link me to a specification? > > Well, http://www.w3.org/TR/CSS2/aural.html defines volume and > play-during. Interesting. > Play-during can stop, autoplay and repeat sounds. > It's not obvious to me how this will apply to elements that represent > audiovisual content but volume: silent; unambiguously mutes content. > Decorating audio (such as background music in games or videos) > seem to be even more easily styled for some reason. Multiple > soundtracks can be muxed and assigned different loudness. > Also @media aural {display: none;} can be used on audio elements > but I haven't read the specs properly so I don't know if that would hide > an element when inside of an @media aural clause. > > CSS 3 aural is still to be done so more capabilities may be suggested. > >>> Well, you have a point. That can be done by increasing the volume >>> of the soundtrack itself, metedata (like embedded volume metadata in >>> MPEG files) and should be possible in CSS. Adding it to HTML as well >>> seems redundant. >> >> Are you saying that a Web author needs to edit the media resource in >> order to change the default volume setting for the resource? I think >> that's a bit of a stretch. Also, if you have a pointer to how this can >> be done in CSS, that would be highly appreciated. > Not necessarily, just pointing out that it would be a good idea to fix the > soundtrack if it's broken. CSS is perfect for these kind of things so I > recommend extending that rather than HTML. Has there been any discussion about implementing support for CSS2 aural in Web browsers? Until such a time - and in fact independently of that - I still think turning the existing volume and muted IDL attributes into content attributes would be a nice and simple solution. Introducing a whole CSS aural control section will take lots longer IMHO. Also, it won't hurt to have both - we do that for width and height, too. Cheers, Silvia.
Re: [whatwg] audio and video: volume and muted as content attributes?
On 5/31/10, Silvia Pfeiffer wrote: > On Tue, Jun 1, 2010 at 6:48 AM, bjartur 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 >>>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. >>>If you want to control the volume for the user after the page loads >>>then yes, you'll need JavaScript. >>>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. >> >> Exactly. >> >>>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. >> >> If you need the audio to be muted you should use CSS. If you need to >> control volume dynamically you need scripting. > > I am not aware of a CSS property for media elements that lets you > control the muted state. Can you link me to a specification? Well, http://www.w3.org/TR/CSS2/aural.html defines volume and play-during. Play-during can stop, autoplay and repeat sounds. It's not obvious to me how this will apply to elements that represent audiovisual content but volume: silent; unambiguously mutes content. Decorating audio (such as background music in games or videos) seem to be even more easily styled for some reason. Multiple soundtracks can be muxed and assigned different loudness. Also @media aural {display: none;} can be used on audio elements but I haven't read the specs properly so I don't know if that would hide an element when inside of an @media aural clause. CSS 3 aural is still to be done so more capabilities may be suggested. >> Well, you have a point. That can be done by increasing the volume >> of the soundtrack itself, metedata (like embedded volume metadata in >> MPEG files) and should be possible in CSS. Adding it to HTML as well >> seems redundant. > > Are you saying that a Web author needs to edit the media resource in > order to change the default volume setting for the resource? I think > that's a bit of a stretch. Also, if you have a pointer to how this can > be done in CSS, that would be highly appreciated. Not necessarily, just pointing out that it would be a good idea to fix the soundtrack if it's broken. CSS is perfect for these kind of things so I recommend extending that rather than HTML. -- kv, - Bjartur
Re: [whatwg] audio and video: volume and muted as content attributes?
On Tue, 01 Jun 2010 14:17:03 +0800, Silvia Pfeiffer wrote: On Tue, Jun 1, 2010 at 3:53 PM, Philip Jägenstedt wrote: On Mon, 31 May 2010 19:33:45 +0800, Silvia Pfeiffer wrote: 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. 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 [1] 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 nuisance. It might be easier if the content attribute for volume was specified as a percentage value between 0 and 100. Then it would be an integer only. I'm not sure if this is possible, but it seems we have more content attributes with these kinds of vlaues (e.g. width/height). This would make volume even more special, as a float that reflects as an integer percentage. Just using the existing definition for reflecting a float would be simpler. 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. Mute alone would already be really helpful. I wasn't aware that volume created such a problem. I'd be fine with reflecting muted if many people think it would be useful. I'm not the one to make that judgment though. Volume isn't a huge problem, just not as trivial as one might suspect. Another thing to consider is that it is currently impossible to set volume to a value outside the range [0,1] via the DOM API. With a content attribute, volume="-1" and volume="1.1" would need to be handled too. I'd prefer it being ignored rather than being clamped. [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect Cheers, Silvia. -- Philip Jägenstedt Core Developer Opera Software
Re: [whatwg] audio and video: volume and muted as content attributes?
On Tue, Jun 1, 2010 at 3:53 PM, Philip Jägenstedt wrote: > On Mon, 31 May 2010 19:33:45 +0800, Silvia Pfeiffer > wrote: > >> 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. >> > > 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 [1] 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 nuisance. It might be easier if the content attribute for volume was specified as a percentage value between 0 and 100. Then it would be an integer only. I'm not sure if this is possible, but it seems we have more content attributes with these kinds of vlaues (e.g. width/height). > 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. Mute alone would already be really helpful. I wasn't aware that volume created such a problem. > [1] > http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect Cheers, Silvia.
Re: [whatwg] audio and video: volume and muted as content attributes?
On Mon, 31 May 2010 19:33:45 +0800, Silvia Pfeiffer wrote: 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. 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 [1] 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 nuisance. 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. [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect -- Philip Jägenstedt Core Developer Opera Software
Re: [whatwg] audio and video: volume and muted as content attributes?
On 31/05/2010 12:33, Silvia Pfeiffer wrote: 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. A less esoteric use case is videos in advertisements, which often begin to play as soon as the ad loads but remain silent until the user explicitly chooses to enable sound (the theory being that the motion of the video will pique the user's interest and compel them to switch on the audio). If there were a muted content attribute, such a video could be inserted into an ad using code as simple as this: (In most cases, script would probably be used to allow the user to enable sound but it's possible that the ad might rely on the user-agent's own controls for this.) Without a muted content attribute, scripting would be required to ensure the video is muted when it starts playing. In cases where the author has not fully considered situations where scripting is not enabled, it is possible that some users may be unintentionally subjected to video that starts playing automatically (because the video element has an autoplay content attribute) at full volume (because the muting is done using script). I also wonder if less-than-bulletproof script solutions might lead to circumstances where the video begins playing before the muting script has executed, causing unwanted sound to be heard briefly. Furthermore, while the lack of a muted content attribute can be alleviated using scripting, the same could be said of the autoplay content attribute. However, such an attribute is specified and has been implemented. Alex -- Alex Bishop alexbis...@gmail.com
Re: [whatwg] audio and video: volume and muted as content attributes?
On Tue, Jun 1, 2010 at 8:37 AM, Aryeh Gregor wrote: > On Mon, May 31, 2010 at 7:33 AM, Silvia Pfeiffer > 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 >> 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 assume the point of these IDL attributes is to allow you to give the > user custom volume and mute buttons. If you want to mute the video or > change its volume non-dynamically, you could just edit the video file, > so HTML doesn't need to replicate that functionality -- only > JavaScript does, for changes in response to user input. I have no issues with @volume and @muted being IDL attributes - it is important to be able to change them from script. What I am wondering is why they cannot also be content attributes. I don't think that would put an extra implementation burden on Web browsers and it would really help with markup simplicity. Also, the suggestion to edit the media resource just to change the loudness seems inappropriate. What if I am referencing a resource that is not on a server that I control? I really don't think introducing these as content attributes creates additional complexity in browsers - seeing as most already offer the muting functionality in context menus and the default controls already implement volume control. Since it comes for cheap and it offers quite a substantial simplification for Web authors, my suggestion is to give them content attribute status. Regards, Silvia.
Re: [whatwg] audio and video: volume and muted as content attributes?
On Tue, Jun 1, 2010 at 6:48 AM, bjartur 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 >>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. >>If you want to control the volume for the user after the page loads >>then yes, you'll need JavaScript. >>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. > > Exactly. > >>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. > > If you need the audio to be muted you should use CSS. If you need to > control volume dynamically you need scripting. I am not aware of a CSS property for media elements that lets you control the muted state. Can you link me to a specification? >>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. > > Well, you have a point. That can be done by increasing the volume > of the soundtrack itself, metedata (like embedded volume metadata in > MPEG files) and should be possible in CSS. Adding it to HTML as well > seems redundant. Are you saying that a Web author needs to edit the media resource in order to change the default volume setting for the resource? I think that's a bit of a stretch. Also, if you have a pointer to how this can be done in CSS, that would be highly appreciated. Thanks, Silvia.
Re: [whatwg] audio and video: volume and muted as content attributes?
On Mon, May 31, 2010 at 7:33 AM, Silvia Pfeiffer 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 > 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 assume the point of these IDL attributes is to allow you to give the user custom volume and mute buttons. If you want to mute the video or change its volume non-dynamically, you could just edit the video file, so HTML doesn't need to replicate that functionality -- only JavaScript does, for changes in response to user input.
Re: [whatwg] audio and video: volume and muted as content attributes?
>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. >If you want to control the volume for the user after the page loads >then yes, you'll need JavaScript. >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. Exactly. >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. If you need the audio to be muted you should use CSS. If you need to control volume dynamically you need scripting. >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. Well, you have a point. That can be done by increasing the volume of the soundtrack itself, metedata (like embedded volume metadata in MPEG files) and should be possible in CSS. Adding it to HTML as well seems redundant.
[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.