Skip to content

Commit

Permalink
[giow] (2) Make sure that we say that enabling audio tracks and selec…
Browse files Browse the repository at this point in the history
…ting video tracks is all synchronised with the event loop

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=25574
Affected topics: HTML, Video and Audio

git-svn-id: http://svn.whatwg.org/webapps@8673 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jun 11, 2014
1 parent 85e17e6 commit 8e91b34
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 27 deletions.
30 changes: 21 additions & 9 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -24770,17 +24770,22 @@ <h4 id=the-video-element><span class=secno>4.7.6 </span>The <dfn id=video><code>
frame corresponding to the <a href=#current-playback-position>current playback position</a> in the video, the new frame
must be rendered.</dd>

</dl><p class=note>Which frame in a video stream corresponds to a particular playback position is
</dl><p>Frames of video must be obtained from the video track that was <a href=#dom-videotrack-selected title=dom-VideoTrack-selected>selected</a> when the <a href=#event-loop>event loop</a> last reached
step 1.</p>

<p class=note>Which frame in a video stream corresponds to a particular playback position is
defined by the video stream's format.</p>

<p>The <code><a href=#the-video-element>video</a></code> element also <a href=#represents>represents</a> any <a href=#text-track-cue title="text track
cue">text track cues</a> whose <a href=#text-track-cue-active-flag>text track cue active flag</a> is set and whose
<a href=#text-track>text track</a> is in the <a href=#text-track-showing title="text track showing">showing</a> mode, and any
audio from the <a href=#media-resource>media resource</a>, at the <a href=#current-playback-position>current playback position</a>.</p>

<!--CLEANUP-->
<p>Any audio associated with the <a href=#media-resource>media resource</a> must, if played, be played
synchronised with the <a href=#current-playback-position>current playback position</a>, at the element's <a href=#effective-media-volume>effective
media volume</a>.</p>
media volume</a>. The user agent must play the audio from audio tracks that were <a href=#dom-audiotrack-enabled title=dom-AudioTrack-enabled>enabled</a> when
the <a href=#event-loop>event loop</a> last reached step 1.</p>

<p>In addition to the above, the user agent may provide messages to the user (such as "buffering",
"no video loaded", "error", or more detailed information) by overlaying text or icons on the video
Expand Down Expand Up @@ -25017,7 +25022,8 @@ <h4 id=the-audio-element><span class=secno>4.7.7 </span>The <dfn id=audio><code>

<p>When an <code><a href=#the-audio-element>audio</a></code> element is <a href=#potentially-playing>potentially playing</a>, it must have its audio
data played synchronised with the <a href=#current-playback-position>current playback position</a>, at the element's
<a href=#effective-media-volume>effective media volume</a>.</p>
<a href=#effective-media-volume>effective media volume</a>. The user agent must play the audio from audio tracks that
were enabled when the <a href=#event-loop>event loop</a> last reached step 1.</p>

<p>When an <code><a href=#the-audio-element>audio</a></code> element is not <a href=#potentially-playing>potentially playing</a>, audio must not play
for the element.</p>
Expand Down Expand Up @@ -25574,11 +25580,12 @@ <h4 id=media-elements><span class=secno>4.7.10 </span>Media elements</h4>

</p>

<!--CLEANUP-->
<p>A <a href=#media-resource>media resource</a> can have multiple audio and video tracks. For the purposes of a
<a href=#media-element>media element</a>, the video data of the <a href=#media-resource>media resource</a> is only that of the
currently selected track (if any) given by the element's <code title=dom-media-videoTracks><a href=#dom-media-videotracks>videoTracks</a></code> attribute, and the audio data of the <a href=#media-resource>media
currently selected track (if any) as given by the element's <code title=dom-media-videoTracks><a href=#dom-media-videotracks>videoTracks</a></code> attribute when the <a href=#event-loop>event loop</a> last reached step 1, and the audio data of the <a href=#media-resource>media
resource</a> is the result of mixing all the currently enabled tracks (if any) given by the
element's <code title=dom-media-audioTracks><a href=#dom-media-audiotracks>audioTracks</a></code> attribute.</p>
element's <code title=dom-media-audioTracks><a href=#dom-media-audiotracks>audioTracks</a></code> attribute when the the <a href=#event-loop>event loop</a> last reached step 1.</p>

<p class=note>Both <code><a href=#the-audio-element>audio</a></code> and <code><a href=#the-video-element>video</a></code> elements can be used for both audio
and video. The main difference between the two is simply that the <code><a href=#the-audio-element>audio</a></code> element has
Expand Down Expand Up @@ -26356,8 +26363,9 @@ <h5 id=loading-the-media-resource><span class=secno>4.7.10.5 </span>Loading the

</li>

<!--CLEANUP-->
<li><p>If <var title="">enable</var> is still <i>unknown</i>, then, if the <a href=#media-element>media
element</a> does not yet have a selected audio track, then set <var title="">enable</var>
element</a> does not yet have an <a href=#dom-audiotrack-enabled title=dom-AudioTrack-enabled>enabled</a> audio track, then set <var title="">enable</var>
to <i>true</i>, otherwise, set <var title="">enable</var> to <i>false</i>.</li>

<li><p>If <var title="">enable</var> is <i>true</i>, then enable this audio track,
Expand Down Expand Up @@ -26396,8 +26404,9 @@ <h5 id=loading-the-media-resource><span class=secno>4.7.10.5 </span>Loading the

</li>

<!--CLEANUP-->
<li><p>If <var title="">enable</var> is still <i>unknown</i>, then, if the <a href=#media-element>media
element</a> does not yet have a selected video track, then set <var title="">enable</var>
element</a> does not yet have a <a href=#dom-videotrack-selected title=dom-VideoTrack-selected>selected</a> video track, then set <var title="">enable</var>
to <i>true</i>, otherwise, set <var title="">enable</var> to <i>false</i>.</li>

<li><p>If <var title="">enable</var> is <i>true</i>, then select this track and unselect any
Expand Down Expand Up @@ -26493,10 +26502,12 @@ <h5 id=loading-the-media-resource><span class=secno>4.7.10.5 </span>Loading the

</li>

<li><p>If there is no enabled audio track, then enable an audio track. This <a href=#toggle-audio-track>will cause a <code title=event-media-change>change</code> event
<!--CLEANUP-->
<li><p>If there is no <a href=#dom-audiotrack-enabled title=dom-AudioTrack-enabled>enabled</a> audio track, then enable an audio track. This <a href=#toggle-audio-track>will cause a <code title=event-media-change>change</code> event
to be fired</a>.</li>

<li><p>If there is no selected video track, then select a video track. This <a href=#toggle-video-track>will cause a <code title=event-media-change>change</code> event
<!--CLEANUP-->
<li><p>If there is no <a href=#dom-videotrack-selected title=dom-VideoTrack-selected>selected</a> video track, then select a video track. This <a href=#toggle-video-track>will cause a <code title=event-media-change>change</code> event
to be fired</a>.</li>

<li><p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media controller</a>, then:
Expand Down Expand Up @@ -28389,6 +28400,7 @@ <h6 id=audiotracklist-and-videotracklist-objects><span class=secno>4.7.10.10.1 <
being selected or unselected has no effect beyond changing the value of the attribute on the
<code><a href=#videotrack>VideoTrack</a></code> object.)</p>

<!--CLEANUP-->
<p id=toggle-video-track>Whenever a track in a <code><a href=#videotracklist>VideoTrackList</a></code> that was previously not selected is selected,
the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-change><a href=#event-media-change>change</a></code> at the <code><a href=#videotracklist>VideoTrackList</a></code> object. This <a href=#concept-task title=concept-task>task</a> must be <a href=#queue-a-task title="queue a task">queued</a> before the
<a href=#concept-task title=concept-task>task</a> that fires the <code title=event-media-resize><a href=#event-media-resize>resize</a></code> event, if any.</p>
Expand Down
30 changes: 21 additions & 9 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -24770,17 +24770,22 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
frame corresponding to the <a href=#current-playback-position>current playback position</a> in the video, the new frame
must be rendered.</dd>

</dl><p class=note>Which frame in a video stream corresponds to a particular playback position is
</dl><p>Frames of video must be obtained from the video track that was <a href=#dom-videotrack-selected title=dom-VideoTrack-selected>selected</a> when the <a href=#event-loop>event loop</a> last reached
step 1.</p>

<p class=note>Which frame in a video stream corresponds to a particular playback position is
defined by the video stream's format.</p>

<p>The <code><a href=#the-video-element>video</a></code> element also <a href=#represents>represents</a> any <a href=#text-track-cue title="text track
cue">text track cues</a> whose <a href=#text-track-cue-active-flag>text track cue active flag</a> is set and whose
<a href=#text-track>text track</a> is in the <a href=#text-track-showing title="text track showing">showing</a> mode, and any
audio from the <a href=#media-resource>media resource</a>, at the <a href=#current-playback-position>current playback position</a>.</p>

<!--CLEANUP-->
<p>Any audio associated with the <a href=#media-resource>media resource</a> must, if played, be played
synchronised with the <a href=#current-playback-position>current playback position</a>, at the element's <a href=#effective-media-volume>effective
media volume</a>.</p>
media volume</a>. The user agent must play the audio from audio tracks that were <a href=#dom-audiotrack-enabled title=dom-AudioTrack-enabled>enabled</a> when
the <a href=#event-loop>event loop</a> last reached step 1.</p>

<p>In addition to the above, the user agent may provide messages to the user (such as "buffering",
"no video loaded", "error", or more detailed information) by overlaying text or icons on the video
Expand Down Expand Up @@ -25017,7 +25022,8 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael

<p>When an <code><a href=#the-audio-element>audio</a></code> element is <a href=#potentially-playing>potentially playing</a>, it must have its audio
data played synchronised with the <a href=#current-playback-position>current playback position</a>, at the element's
<a href=#effective-media-volume>effective media volume</a>.</p>
<a href=#effective-media-volume>effective media volume</a>. The user agent must play the audio from audio tracks that
were enabled when the <a href=#event-loop>event loop</a> last reached step 1.</p>

<p>When an <code><a href=#the-audio-element>audio</a></code> element is not <a href=#potentially-playing>potentially playing</a>, audio must not play
for the element.</p>
Expand Down Expand Up @@ -25574,11 +25580,12 @@ interface <dfn id=htmlmediaelement>HTMLMediaElement</dfn> : <a href=#htmlelement

</p>

<!--CLEANUP-->
<p>A <a href=#media-resource>media resource</a> can have multiple audio and video tracks. For the purposes of a
<a href=#media-element>media element</a>, the video data of the <a href=#media-resource>media resource</a> is only that of the
currently selected track (if any) given by the element's <code title=dom-media-videoTracks><a href=#dom-media-videotracks>videoTracks</a></code> attribute, and the audio data of the <a href=#media-resource>media
currently selected track (if any) as given by the element's <code title=dom-media-videoTracks><a href=#dom-media-videotracks>videoTracks</a></code> attribute when the <a href=#event-loop>event loop</a> last reached step 1, and the audio data of the <a href=#media-resource>media
resource</a> is the result of mixing all the currently enabled tracks (if any) given by the
element's <code title=dom-media-audioTracks><a href=#dom-media-audiotracks>audioTracks</a></code> attribute.</p>
element's <code title=dom-media-audioTracks><a href=#dom-media-audiotracks>audioTracks</a></code> attribute when the the <a href=#event-loop>event loop</a> last reached step 1.</p>

<p class=note>Both <code><a href=#the-audio-element>audio</a></code> and <code><a href=#the-video-element>video</a></code> elements can be used for both audio
and video. The main difference between the two is simply that the <code><a href=#the-audio-element>audio</a></code> element has
Expand Down Expand Up @@ -26356,8 +26363,9 @@ interface <dfn id=htmlmediaelement>HTMLMediaElement</dfn> : <a href=#htmlelement

</li>

<!--CLEANUP-->
<li><p>If <var title="">enable</var> is still <i>unknown</i>, then, if the <a href=#media-element>media
element</a> does not yet have a selected audio track, then set <var title="">enable</var>
element</a> does not yet have an <a href=#dom-audiotrack-enabled title=dom-AudioTrack-enabled>enabled</a> audio track, then set <var title="">enable</var>
to <i>true</i>, otherwise, set <var title="">enable</var> to <i>false</i>.</li>

<li><p>If <var title="">enable</var> is <i>true</i>, then enable this audio track,
Expand Down Expand Up @@ -26396,8 +26404,9 @@ interface <dfn id=htmlmediaelement>HTMLMediaElement</dfn> : <a href=#htmlelement

</li>

<!--CLEANUP-->
<li><p>If <var title="">enable</var> is still <i>unknown</i>, then, if the <a href=#media-element>media
element</a> does not yet have a selected video track, then set <var title="">enable</var>
element</a> does not yet have a <a href=#dom-videotrack-selected title=dom-VideoTrack-selected>selected</a> video track, then set <var title="">enable</var>
to <i>true</i>, otherwise, set <var title="">enable</var> to <i>false</i>.</li>

<li><p>If <var title="">enable</var> is <i>true</i>, then select this track and unselect any
Expand Down Expand Up @@ -26493,10 +26502,12 @@ interface <dfn id=htmlmediaelement>HTMLMediaElement</dfn> : <a href=#htmlelement

</li>

<li><p>If there is no enabled audio track, then enable an audio track. This <a href=#toggle-audio-track>will cause a <code title=event-media-change>change</code> event
<!--CLEANUP-->
<li><p>If there is no <a href=#dom-audiotrack-enabled title=dom-AudioTrack-enabled>enabled</a> audio track, then enable an audio track. This <a href=#toggle-audio-track>will cause a <code title=event-media-change>change</code> event
to be fired</a>.</li>

<li><p>If there is no selected video track, then select a video track. This <a href=#toggle-video-track>will cause a <code title=event-media-change>change</code> event
<!--CLEANUP-->
<li><p>If there is no <a href=#dom-videotrack-selected title=dom-VideoTrack-selected>selected</a> video track, then select a video track. This <a href=#toggle-video-track>will cause a <code title=event-media-change>change</code> event
to be fired</a>.</li>

<li><p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media controller</a>, then:
Expand Down Expand Up @@ -28389,6 +28400,7 @@ interface <dfn id=videotrack>VideoTrack</dfn> {
being selected or unselected has no effect beyond changing the value of the attribute on the
<code><a href=#videotrack>VideoTrack</a></code> object.)</p>

<!--CLEANUP-->
<p id=toggle-video-track>Whenever a track in a <code><a href=#videotracklist>VideoTrackList</a></code> that was previously not selected is selected,
the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-change><a href=#event-media-change>change</a></code> at the <code><a href=#videotracklist>VideoTrackList</a></code> object. This <a href=#concept-task title=concept-task>task</a> must be <a href=#queue-a-task title="queue a task">queued</a> before the
<a href=#concept-task title=concept-task>task</a> that fires the <code title=event-media-resize><a href=#event-media-resize>resize</a></code> event, if any.</p>
Expand Down
Loading

0 comments on commit 8e91b34

Please sign in to comment.