Skip to content

Commit

Permalink
Introduce associated AudioSession (#32)
Browse files Browse the repository at this point in the history
SHA: f62ea81
Reason: push, by youennf

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
youennf and github-actions[bot] committed Oct 22, 2024
1 parent 8ab46c5 commit b3ed613
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link href="https://www.w3.org/StyleSheets/TR/2021/W3C-ED" rel="stylesheet">
<meta content="Bikeshed version 44fb9b41e, updated Mon Oct 21 15:57:35 2024 -0700" name="generator">
<link href="https://w3c.github.io/audio-session/" rel="canonical">
<meta content="ef5f33bcf6209c31ad5871daa9ce56d1615d35ab" name="revision">
<meta content="f62ea81a18c589d8351b2a91cf2045f9ad920783" name="revision">
<meta content="dark light" name="color-scheme">
<link href="https://www.w3.org/StyleSheets/TR/2021/dark.css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css">
<style>/* Boilerplate: style-autolinks */
Expand Down Expand Up @@ -905,10 +905,15 @@ <h3 class="heading settled" data-level="3.2" id="audio-session-states"><span cla
</pre>
<p>The <a data-link-type="dfn" href="#audio-session" id="ref-for-audio-session①④">audio session</a>'s state may change, which will automatically <a data-link-type="dfn">update the state</a> of its <code class="idl"><a data-link-type="idl" href="#audiosession" id="ref-for-audiosession①⓪">AudioSession</a></code> object.</p>
<h2 class="heading settled" data-level="4" id="extensions-to-navigator"><span class="secno">4. </span><span class="content">Extensions to the <code>Navigator</code> interface</span><a class="self-link" href="#extensions-to-navigator"></a></h2>
<p>Each <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#window" id="ref-for-window">Window</a></code> has an <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="associated-audiosession">associated AudioSession</dfn>, which is an <code class="idl"><a data-link-type="idl" href="#audiosession" id="ref-for-audiosession①①">AudioSession</a></code> object.
It represents the default audio session that is used by the user agent to automatically set up the audio session parameters.
The user agent will request or abandon audio focus when audio session <a data-link-type="dfn" href="#audio-session-element" id="ref-for-audio-session-element⑤">elements</a> start or finish playing.
Upon creation of the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#window" id="ref-for-window①">Window</a></code> object, its <a data-link-type="dfn" href="#associated-audiosession" id="ref-for-associated-audiosession">associated AudioSession</a> MUST be set to a newly created <code class="idl"><a data-link-type="idl" href="#audiosession" id="ref-for-audiosession①②">AudioSession</a></code> object with the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#window" id="ref-for-window②">Window</a></code> object’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm" id="ref-for-concept-relevant-realm">relevant realm</a>.</p>
<p>The <a data-link-type="dfn" href="#associated-audiosession" id="ref-for-associated-audiosession①">associated AudioSession</a> list of <a data-link-type="dfn" href="#audio-session-element" id="ref-for-audio-session-element⑥">elements</a> is updated dynamically as audio sources and sinks of the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#window" id="ref-for-window③">Window</a></code> object are created or removed.</p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator①"><c- g>Navigator</c-></a> {
// The default audio session that the user agent will use when media elements start/stop playing.
<c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#audiosession" id="ref-for-audiosession①"><c- n>AudioSession</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Navigator" data-dfn-type="attribute" data-export data-readonly data-type="AudioSession" id="dom-navigator-audiosession"><code><c- g>audioSession</c-></code></dfn>;
<c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#audiosession" id="ref-for-audiosession①"><c- n>AudioSession</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Navigator" data-dfn-type="attribute" data-export data-readonly data-type="AudioSession" id="dom-navigator-audiosession"><code><c- g>audioSession</c-></code></dfn>;
};
</pre>
<h2 class="heading settled" data-level="5" id="privacy"><span class="secno">5. </span><span class="content">Privacy considerations</span><a class="self-link" href="#privacy"></a></h2>
Expand Down Expand Up @@ -1028,6 +1033,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c
<li><a href="#dom-audiosessiontype-ambient">"ambient"</a><span>, in § 3.1</span>
<li><a href="#dom-audiosessiontype-ambient">ambient</a><span>, in § 3.1</span>
<li><a href="#audiosession-appliedtype">[[appliedType]]</a><span>, in § 3</span>
<li><a href="#associated-audiosession">associated AudioSession</a><span>, in § 4</span>
<li><a href="#audible-element">audible element</a><span>, in § 2</span>
<li><a href="#audible-flag">audible flag</a><span>, in § 2</span>
<li><a href="#top-level-browsing-context-audio-focus">audio focus</a><span>, in § 2</span>
Expand Down Expand Up @@ -1090,6 +1096,8 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
<li><span class="dfn-paneled" id="f0951476">EventHandler</span>
<li><span class="dfn-paneled" id="1076ec40">HTMLMediaElement</span>
<li><span class="dfn-paneled" id="be0c27b2">Navigator</span>
<li><span class="dfn-paneled" id="5d7209e9">Window</span>
<li><span class="dfn-paneled" id="5991ccfb">relevant realm</span>
<li><span class="dfn-paneled" id="ae2a6342">top-level browsing context</span>
</ul>
<li>
Expand Down Expand Up @@ -1350,19 +1358,22 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I
let dfnPanelData = {
"1076ec40": {"dfnID":"1076ec40","dfnText":"HTMLMediaElement","external":true,"refSections":[{"refs":[{"id":"ref-for-htmlmediaelement"}],"title":"2. Concepts"}],"url":"https://html.spec.whatwg.org/multipage/media.html#htmlmediaelement"},
"2bc0cdf4": {"dfnID":"2bc0cdf4","dfnText":"EventTarget","external":true,"refSections":[{"refs":[{"id":"ref-for-eventtarget"}],"title":"3. The AudioSession interface"}],"url":"https://dom.spec.whatwg.org/#eventtarget"},
"5991ccfb": {"dfnID":"5991ccfb","dfnText":"relevant realm","external":true,"refSections":[{"refs":[{"id":"ref-for-concept-relevant-realm"}],"title":"4. Extensions to the Navigator interface"}],"url":"https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm"},
"5d7209e9": {"dfnID":"5d7209e9","dfnText":"Window","external":true,"refSections":[{"refs":[{"id":"ref-for-window"},{"id":"ref-for-window\u2460"},{"id":"ref-for-window\u2461"},{"id":"ref-for-window\u2462"}],"title":"4. Extensions to the Navigator interface"}],"url":"https://html.spec.whatwg.org/multipage/nav-history-apis.html#window"},
"889e932f": {"dfnID":"889e932f","dfnText":"Exposed","external":true,"refSections":[{"refs":[{"id":"ref-for-Exposed"}],"title":"3. The AudioSession interface"},{"refs":[{"id":"ref-for-Exposed\u2460"}],"title":"4. Extensions to the Navigator interface"}],"url":"https://webidl.spec.whatwg.org/#Exposed"},
"ae2a6342": {"dfnID":"ae2a6342","dfnText":"top-level browsing context","external":true,"refSections":[{"refs":[{"id":"ref-for-top-level-browsing-context"},{"id":"ref-for-top-level-browsing-context\u2460"},{"id":"ref-for-top-level-browsing-context\u2461"},{"id":"ref-for-top-level-browsing-context\u2462"}],"title":"2. Concepts"}],"url":"https://html.spec.whatwg.org/multipage/document-sequences.html#top-level-browsing-context"},
"associated-audiosession": {"dfnID":"associated-audiosession","dfnText":"associated AudioSession","external":false,"refSections":[{"refs":[{"id":"ref-for-associated-audiosession"},{"id":"ref-for-associated-audiosession\u2460"}],"title":"4. Extensions to the Navigator interface"}],"url":"#associated-audiosession"},
"audible-element": {"dfnID":"audible-element","dfnText":"audible element","external":false,"refSections":[{"refs":[{"id":"ref-for-audible-element"}],"title":"3. The AudioSession interface"}],"url":"#audible-element"},
"audible-flag": {"dfnID":"audible-flag","dfnText":"audible flag","external":false,"refSections":[{"refs":[{"id":"ref-for-audible-flag"}],"title":"2. Concepts"}],"url":"#audible-flag"},
"audio-session": {"dfnID":"audio-session","dfnText":"audio session","external":false,"refSections":[{"refs":[{"id":"ref-for-audio-session"},{"id":"ref-for-audio-session\u2460"},{"id":"ref-for-audio-session\u2461"},{"id":"ref-for-audio-session\u2462"},{"id":"ref-for-audio-session\u2463"},{"id":"ref-for-audio-session\u2464"}],"title":"2. Concepts"},{"refs":[{"id":"ref-for-audio-session\u2465"},{"id":"ref-for-audio-session\u2466"},{"id":"ref-for-audio-session\u2467"}],"title":"3. The AudioSession interface"},{"refs":[{"id":"ref-for-audio-session\u2468"}],"title":"3.1. Audio session types"},{"refs":[{"id":"ref-for-audio-session\u2460\u24ea"},{"id":"ref-for-audio-session\u2460\u2460"},{"id":"ref-for-audio-session\u2460\u2461"},{"id":"ref-for-audio-session\u2460\u2462"},{"id":"ref-for-audio-session\u2460\u2463"}],"title":"3.2. Audio session states"}],"url":"#audio-session"},
"audio-session-default-type": {"dfnID":"audio-session-default-type","dfnText":"default type","external":false,"refSections":[],"url":"#audio-session-default-type"},
"audio-session-element": {"dfnID":"audio-session-element","dfnText":"elements","external":false,"refSections":[{"refs":[{"id":"ref-for-audio-session-element"},{"id":"ref-for-audio-session-element\u2460"},{"id":"ref-for-audio-session-element\u2461"}],"title":"2. Concepts"},{"refs":[{"id":"ref-for-audio-session-element\u2462"},{"id":"ref-for-audio-session-element\u2463"}],"title":"3. The AudioSession interface"}],"url":"#audio-session-element"},
"audio-session-element": {"dfnID":"audio-session-element","dfnText":"elements","external":false,"refSections":[{"refs":[{"id":"ref-for-audio-session-element"},{"id":"ref-for-audio-session-element\u2460"},{"id":"ref-for-audio-session-element\u2461"}],"title":"2. Concepts"},{"refs":[{"id":"ref-for-audio-session-element\u2462"},{"id":"ref-for-audio-session-element\u2463"}],"title":"3. The AudioSession interface"},{"refs":[{"id":"ref-for-audio-session-element\u2464"},{"id":"ref-for-audio-session-element\u2465"}],"title":"4. Extensions to the Navigator interface"}],"url":"#audio-session-element"},
"audio-session-element-resume-steps": {"dfnID":"audio-session-element-resume-steps","dfnText":"Element resume steps","external":false,"refSections":[],"url":"#audio-session-element-resume-steps"},
"audio-session-element-suspend-steps": {"dfnID":"audio-session-element-suspend-steps","dfnText":"Element suspend steps","external":false,"refSections":[],"url":"#audio-session-element-suspend-steps"},
"audio-session-element-update-steps": {"dfnID":"audio-session-element-update-steps","dfnText":"Element update steps","external":false,"refSections":[],"url":"#audio-session-element-update-steps"},
"audio-session-state": {"dfnID":"audio-session-state","dfnText":"state","external":false,"refSections":[{"refs":[{"id":"ref-for-audio-session-state"}],"title":"2. Concepts"},{"refs":[{"id":"ref-for-audio-session-state\u2460"},{"id":"ref-for-audio-session-state\u2461"}],"title":"3. The AudioSession interface"}],"url":"#audio-session-state"},
"audio-session-type": {"dfnID":"audio-session-type","dfnText":"types","external":false,"refSections":[{"refs":[{"id":"ref-for-audio-session-type"},{"id":"ref-for-audio-session-type\u2460"}],"title":"2. Concepts"},{"refs":[{"id":"ref-for-audio-session-type\u2461"},{"id":"ref-for-audio-session-type\u2462"},{"id":"ref-for-audio-session-type\u2463"},{"id":"ref-for-audio-session-type\u2464"}],"title":"3. The AudioSession interface"}],"url":"#audio-session-type"},
"audiosession": {"dfnID":"audiosession","dfnText":"AudioSession","external":false,"refSections":[{"refs":[{"id":"ref-for-audiosession"},{"id":"ref-for-audiosession\u2460"},{"id":"ref-for-audiosession\u2461"},{"id":"ref-for-audiosession\u2462"},{"id":"ref-for-audiosession\u2463"},{"id":"ref-for-audiosession\u2464"},{"id":"ref-for-audiosession\u2465"},{"id":"ref-for-audiosession\u2466"},{"id":"ref-for-audiosession\u2467"}],"title":"3. The AudioSession interface"},{"refs":[{"id":"ref-for-audiosession\u2468"}],"title":"3.1. Audio session types"},{"refs":[{"id":"ref-for-audiosession\u2460\u24ea"}],"title":"3.2. Audio session states"},{"refs":[{"id":"ref-for-audiosession\u2460\u2460"}],"title":"4. Extensions to the Navigator interface"}],"url":"#audiosession"},
"audiosession": {"dfnID":"audiosession","dfnText":"AudioSession","external":false,"refSections":[{"refs":[{"id":"ref-for-audiosession"},{"id":"ref-for-audiosession\u2460"},{"id":"ref-for-audiosession\u2461"},{"id":"ref-for-audiosession\u2462"},{"id":"ref-for-audiosession\u2463"},{"id":"ref-for-audiosession\u2464"},{"id":"ref-for-audiosession\u2465"},{"id":"ref-for-audiosession\u2466"},{"id":"ref-for-audiosession\u2467"}],"title":"3. The AudioSession interface"},{"refs":[{"id":"ref-for-audiosession\u2468"}],"title":"3.1. Audio session types"},{"refs":[{"id":"ref-for-audiosession\u2460\u24ea"}],"title":"3.2. Audio session states"},{"refs":[{"id":"ref-for-audiosession\u2460\u2460"},{"id":"ref-for-audiosession\u2460\u2461"},{"id":"ref-for-audiosession\u2460\u2462"}],"title":"4. Extensions to the Navigator interface"}],"url":"#audiosession"},
"audiosession-appliedtype": {"dfnID":"audiosession-appliedtype","dfnText":"[[appliedType]]","external":false,"refSections":[],"url":"#audiosession-appliedtype"},
"audiosession-elements": {"dfnID":"audiosession-elements","dfnText":"[[elements]]","external":false,"refSections":[],"url":"#audiosession-elements"},
"audiosession-interruptedelements": {"dfnID":"audiosession-interruptedelements","dfnText":"[[interruptedElements]]","external":false,"refSections":[],"url":"#audiosession-interruptedelements"},
Expand Down Expand Up @@ -1779,6 +1790,7 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I
"use strict";
{
let refsData = {
"#associated-audiosession": {"export":true,"for_":[],"level":"","normative":true,"shortname":"audio-session","spec":"audio-session","status":"local","text":"associated audiosession","type":"dfn","url":"#associated-audiosession"},
"#audible-element": {"export":true,"for_":[],"level":"","normative":true,"shortname":"audio-session","spec":"audio-session","status":"local","text":"audible element","type":"dfn","url":"#audible-element"},
"#audible-flag": {"export":true,"for_":[],"level":"","normative":true,"shortname":"audio-session","spec":"audio-session","status":"local","text":"audible flag","type":"dfn","url":"#audible-flag"},
"#audio-session": {"export":true,"for_":[],"level":"","normative":true,"shortname":"audio-session","spec":"audio-session","status":"local","text":"audio session","type":"dfn","url":"#audio-session"},
Expand All @@ -1804,7 +1816,9 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I
"https://dom.spec.whatwg.org/#eventtarget": {"export":true,"for_":[],"level":"1","normative":true,"shortname":"dom","spec":"dom","status":"current","text":"EventTarget","type":"interface","url":"https://dom.spec.whatwg.org/#eventtarget"},
"https://html.spec.whatwg.org/multipage/document-sequences.html#top-level-browsing-context": {"export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"top-level browsing context","type":"dfn","url":"https://html.spec.whatwg.org/multipage/document-sequences.html#top-level-browsing-context"},
"https://html.spec.whatwg.org/multipage/media.html#htmlmediaelement": {"export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"HTMLMediaElement","type":"interface","url":"https://html.spec.whatwg.org/multipage/media.html#htmlmediaelement"},
"https://html.spec.whatwg.org/multipage/nav-history-apis.html#window": {"export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"Window","type":"interface","url":"https://html.spec.whatwg.org/multipage/nav-history-apis.html#window"},
"https://html.spec.whatwg.org/multipage/system-state.html#navigator": {"export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"Navigator","type":"interface","url":"https://html.spec.whatwg.org/multipage/system-state.html#navigator"},
"https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm": {"export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"relevant realm","type":"dfn","url":"https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm"},
"https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler": {"export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"EventHandler","type":"typedef","url":"https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler"},
"https://webaudio.github.io/web-audio-api/#AudioContext": {"export":true,"for_":[],"level":"1","normative":true,"shortname":"webaudio","spec":"webaudio","status":"current","text":"AudioContext","type":"interface","url":"https://webaudio.github.io/web-audio-api/#AudioContext"},
"https://webidl.spec.whatwg.org/#Exposed": {"export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"Exposed","type":"extended-attribute","url":"https://webidl.spec.whatwg.org/#Exposed"},
Expand Down

0 comments on commit b3ed613

Please sign in to comment.