Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does conditional processing mute sound playback? #44

Closed
karip opened this issue Feb 5, 2016 · 7 comments
Closed

Does conditional processing mute sound playback? #44

karip opened this issue Feb 5, 2016 · 7 comments

Comments

@karip
Copy link

karip commented Feb 5, 2016

Does sound play for audio and video elements which are hidden by conditional processing?

The current text only mentions rendering, but it doesn't say how events, animations or sound are affected. An improved wording to address events and animations was suggested: “All others will not be rendered (as if the display property were set to none.)” [1]

However, that also suggests that sound is always played.

Can you add the improved wording and mention how sound is affected?

[1] https://lists.w3.org/Archives/Public/www-svg/2014Mar/0049.html

@AmeliaBR
Copy link
Contributor

AmeliaBR commented Feb 5, 2016

To answer your question: yes, conditional processing would be expected to affect audio and video playback. I am almost certain that display: none would also prevent audio/video from playing, but I couldn't find a good spec reference for that.

I do agree that the language could be improved to address audio/video. In addition to whether resources are played, there is the question of whether user agents should download content that they aren't going to use. I don't know what current behavior is for <image> in <switch> on that point.

@tabatkins
Copy link
Member

Yes, display:none stops <audio>/<video>. I think HTML specifies this now?

@AmeliaBR
Copy link
Contributor

AmeliaBR commented Jun 3, 2016

I can't find any spec in HTML or CSS that discusses the interaction of display with <audio> and <video>. Quick testing shows that (in at least some browsers) display affects visual rendering of videos, but does not pause video progress or affect audio.

I still think it would be useful to have audio/video disabled by SVG conditional processing, but we'll need to be explicit: it should disable all processing, including file download. Not sure how this disabled state should be reflected in the HTML DOM APIs, though.

I've added an issue to the spec itself, as I cleaned up some of the related text.

@karip
Copy link
Author

karip commented Jul 20, 2016

After thinking about this, I would expect <audio> and <video> to behave like <image>. For instance, <use> referencing <video> under <switch> should show it playing. This means that <video> must be fetched and played back even if conditional processing hides it.

CSS Media queries have the same issue with audio and video. Audio and video get played although media queries have hidden them.

Since <switch> and media queries both have the same issue, I think that they should be solved in the same way. <audio> and <video> are HTML elements, so I would let HTML/CSS solve this issue (by not playing when display is none or some other means).

So, this isn’t really an SVG related issue and should be just closed.

@AmeliaBR
Copy link
Contributor

@karip

I was seeing conditional processing more equivalent to <picture>/video track selection, not a media query. Your point about <use> element cross-references is valid, but with a full cloning model for <use> it doesn't have to be definitive: the cloned element fetches the resource, even if the original didn't.

As I mention in a comment on the <use> element discussion, if we make conditional processing just act as display: none, it's a lot easier to implement but also a lot less useful. There would be no way to extend it to include <picture>-like behavior in the future.

@nikosandronikos
Copy link
Member

At this morning's telcon, we resolved that conditional processing will function as display:none.

There was a general preference for conditional processing being were more useful than that, but since interest in the feature is perceived to be low, we opted for the simpler model.

https://www.w3.org/2016/07/21-svg-minutes.html#resolution02

@nikosandronikos nikosandronikos self-assigned this Jul 22, 2016
@nikosandronikos
Copy link
Member

4.9.1 already says (emphasis mine):

When an element is excluded because of conditional processing, it is treated as if it had a used value of none for the display property. Similar to the display property, conditional processing attributes only affect the direct rendering of elements and do not prevent elements from being successfully referenced by other elements (such as via a ‘use’).

I think that's enough, since after today's resolution we take this literally for every element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants