Skip to content

Commit e31b45b

Browse files
committed
Skip looping the media element when paused
The existing steps cause a seek to the end of the media resource while paused to seek to the start immediately after. This differs from implementations in Chrome, Firefox and Safari. Fixes #11774
1 parent 9d8861e commit e31b45b

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

source

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39690,13 +39690,20 @@ interface <dfn interface>MediaError</dfn> {
3969039690
agent must follow these steps:</p>
3969139691

3969239692
<ol>
39693-
<li><p>If the <span>media element</span> has a <code data-x="attr-media-loop">loop</code>
39694-
attribute specified, then <span data-x="dom-media-seek">seek</span> to the <span>earliest
39695-
possible position</span> of the <span>media resource</span> and return.</p></li>
39696-
<!-- v2/v3: We should fire a 'looping' event here to explain why this immediately fires a
39697-
'playing' event, otherwise the 'playing' event that fires from the readyState going from
39698-
HAVE_CURRENT_DATA back to HAVE_FUTURE_DATA will seem inexplicable (since the normally matching
39699-
'ended' given below event doesn't fire in the loop case). -->
39693+
<li>
39694+
<p>If the <span>media element</span> has a <code data-x="attr-media-loop">loop</code>
39695+
attribute specified, then:</p>
39696+
39697+
<ol>
39698+
<li>If <span data-x="dom-media-paused">paused</span> is false, <span data-x="dom-media-seek">
39699+
seek</span> to the <span>earliest possible position</span> of the <span>media resource</span>
39700+
and return.</p></li>
39701+
<!-- v2/v3: We should fire a 'looping' event here to explain why this immediately fires a
39702+
'playing' event, otherwise the 'playing' event that fires from the readyState going from
39703+
HAVE_CURRENT_DATA back to HAVE_FUTURE_DATA will seem inexplicable (since the normally matching
39704+
'ended' given below event doesn't fire in the loop case). -->
39705+
</ol>
39706+
</li>
3970039707

3970139708
<li><p>As defined above, the <code data-x="dom-media-ended">ended</code> IDL attribute starts
3970239709
returning true once the <span>event loop</span> returns to <a href="#step1">step 1</a>.</p></li>
@@ -39945,7 +39952,10 @@ interface <dfn interface>MediaError</dfn> {
3994539952
data-x="dom-media-readyState">readyState</code> attribute has the value <code
3994639953
data-x="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code> or <code
3994739954
data-x="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code>: <span>notify about playing</span>
39948-
for the element.</p>
39955+
for the element, and if playback was paused and loop was specified the last time playback <a
39956+
href="#reaches-the-end">reached the end</a> (i.e. when the <span>official playback
39957+
position</span> is still the <span>duration</span> at this step), seek to the <span>earliest
39958+
possible position</span>.</p>
3994939959
</li>
3995039960
</ol>
3995139961
</li>

0 commit comments

Comments
 (0)