Skip to content

Conversation

@gabrielsanbrito
Copy link
Collaborator

@gabrielsanbrito gabrielsanbrito commented Oct 22, 2025

index.bs Outdated

## Web Audio ## {#web-audio-integration}

Let |frame| be an <{iframe}>. Let {{Document}} |document| be the [=content document=] of one of |frame|'s [=child navigables=]. Let |audioContext| be an {{AudioContext}} in |document|.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iframe

What if the policy is applied to a top level document? Do we need to generlize this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the terminology usage to be more precise. Main difference now is that I am taking into consideration whether the document's navigable is a top-level traversable. LMK what you think.

SteveBeckerMSFT
SteveBeckerMSFT previously approved these changes Nov 5, 2025
Let |audioContext| be an {{AudioContext}}. Let {{Document}} |document| be the |audioContext|'s [=relevant global object=]'s [=associated Document=]. Let |navigable| be [=/Navigable=] whose [=active document=] is |document|. Let |navigableContainer| be the [=navigable container=] whose [=content document=] is |document|.

Amend the definition of [=allowed to start=] so that |audioContext| is also not [=allowed to start=] if all the following conditions are met:
- |navigableContainer| is not null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that the permission policy does not apply to top level documents?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. IIUC, top-level documents do not have a navigable container and thus cannot be "not rendered".

@alastor0325
Copy link

A quick question I’d like to raise is about the part of your proposal where media is prevented from playing again. I’m concerned this could create conflicts with system-level media controls.

For example, if an iframe outside the viewport gets paused due to this spec, but the user later tries to resume it using system media controls—such as physical media buttons or the platform’s virtual media interface— while the iframe is still out of the viewport, then the iframe wouldn’t be able to resume correctly because the play/resume would be rejected.

In addition, just as an FYI from our (Mozilla) past experience: pausing a media element from the browser is usually fine, but pausing Web Audio can cause issues, as some sites don’t expect their audio context to be externally paused. This can make it difficult for users to resume playback.

The proposal sounds reasonable overall, but there are definitely more implementation-level details worth discussing, especially regarding Media Session, Audio Session, and Picture-in-Picture as mentioned in the meeting.

@gabrielsanbrito
Copy link
Collaborator Author

Thanks for the comment @alastor0325! I created the issues below to track this upcoming work:

Copy link

@alastor0325 alastor0325 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This spec looks good to us (Mozilla). I’ve left a few comments, and we’d be happy to discuss any follow-up issues. Please feel free to ping @padenot or me if you need any additional input from our side. Thanks!

@gabrielsanbrito gabrielsanbrito merged commit 098b399 into WICG:main Dec 1, 2025
2 checks passed
@gabrielsanbrito
Copy link
Collaborator Author

Thanks for the feedback, @alastor0325 and @padenot!

github-actions bot added a commit that referenced this pull request Dec 1, 2025
SHA: 098b399
Reason: push, by gabrielsanbrito

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants