On Mon, Jul 26, 2010 at 7:49 PM, Philip Jägenstedt <span dir="ltr"><<a href="mailto:philipj@opera.com">philipj@opera.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On Mon, 26 Jul 2010 02:58:07 +0200, Silvia Pfeiffer <<a href="mailto:silviapfeiffer1@gmail.com" target="_blank">silviapfeiffer1@gmail.com</a>> wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">
On Sun, Jul 25, 2010 at 3:31 PM, Maciej Stachowiak <<a href="mailto:mjs@apple.com" target="_blank">mjs@apple.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
On Jul 23, 2010, at 7:16 AM, Philip Jägenstedt wrote:<br>
<br>
Silvia made we aware of discrepancy in how browsers implement the resource<br>
selection algorithm, see forwarded message. It's my assessment that Opera is<br>
the only browser following the spec. I've filed this bug with Mozilla:<br>
<br>
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=581355" target="_blank">https://bugzilla.mozilla.org/show_bug.cgi?id=581355</a><br>
<br>
I've also reported bugs in Chrome and Safari, but can't see where they<br>
ended up.<br>
<br>
The reason I'm writing this email is that apparently everyone but myself<br>
has a different interpretation of the spec, so perhaps this is something we<br>
need to discuss. Does any other browser ever set the state NETWORK_NO_SOURCE<br>
at all? I speculated that perhaps other browsers aren't very strict about<br>
which parts of the algorithm are run synchronously and not, but even<br>
checking the networkState after a setTimeout it still isn't<br>
NETWORK_NO_SOURCE.<br>
<br>
Test case: <a href="http://people.opera.com/philipj/2010/07/23/networkState.html" target="_blank">http://people.opera.com/philipj/2010/07/23/networkState.html</a><br>
<br>
Please fix implementation or spec :)<br>
<br>
<br>
1) Which behavior is more useful?<br>
2) Sylvia's original issue was with play() - should we ensure that any time<br>
you call play(), it will cause the media resource to start playing once<br>
loaded? That seems like the real spec bug.<br>
<br>
</blockquote>
<br>
The problem there with play in Opera was that the @src was changed, but<br>
Opera doesn't run the resource selection algorithm to load it for play(),<br>
but instead expects to run load() first. The description of play() however<br>
clearly states as a first step:<br>
1. If the media<br></div></div>
element<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element</a>>'s<br>
networkState<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#dom-media-networkstate" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#dom-media-networkstate</a>>attribute<br>
has the value<br>
NETWORK_EMPTY<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#dom-media-network_empty" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#dom-media-network_empty</a>>,<br>
invoke the media<br>
element<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element</a>>'s<br>
resource selection<br>
algorithm<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#concept-media-load-algorithm" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#concept-media-load-algorithm</a>><div class="im">
<br>
.<br>
<br>
This is why we are discussing whether the networkState needs to be<br>
NETWORK_EMPTY or NETWORK_NO_SOURCE after initialisation of a media element.<br>
<br>
Incidentally, that has effects on other elements, too, such as for <source><br>
it is stated:<br></div>
If a source<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#the-source-element" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#the-source-element</a>>element<div class="im">
<br>
is inserted as a child of a media<br></div>
element<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element</a>>that<br>
has no<br>
src<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#attr-media-src" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#attr-media-src</a>>attribute<br>
and whose<br>
networkState<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#dom-media-networkstate" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#dom-media-networkstate</a>>has<br>
the value<br>
NETWORK_EMPTY<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#dom-media-network_empty" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#dom-media-network_empty</a>>,<div class="im">
<br>
the user agent must invoke the media<br></div>
element<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element</a>>'s<br>
resource selection<br>
algorithm<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#concept-media-load-algorithm" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#concept-media-load-algorithm</a>><div class="im">
<br>
.<br>
<br>
And for @src it is said:<br></div>
If a src<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#attr-media-src" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#attr-media-src</a>>attribute<br>
of a media<br>
element<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element</a>>is<div class="im">
<br>
set or changed, the user agent must invoke the media<br></div>
element<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element</a>>'s<br>
media element load<br>
algorithm<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element-load-algorithm" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#media-element-load-algorithm</a>>.<br>
(*Removing* the<br>
src<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#attr-media-src" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#attr-media-src</a>>attribute<div class="im">
<br>
does not do this, even if there are<br></div>
source<<a href="http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#the-source-element" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/complete/video.html#the-source-element</a>>elements<div class="im">
<br>
present.)<br>
<br>
That is kinda strange, too, because really when @src is changed, resource<br>
selection has to be run first rather than media element load.<br>
</div></blockquote>
<br>
The load algorithm is just a wrapper for the resource selection algorithm that makes sure that a previously running resource selection algorithm is aborted in an orderly fashion and that the state is reset. What's strange?<br>
</blockquote><div><br>I misread that, too. I thought it was pointing to the resource fetch algorithm and not the media element load algorithm. You're right - this part is fine.<br><br><br>Incidentally, your test isn't complete. In my test file, I was actually setting the @src values of the <source> elements to resources that existed and then called the play() function. That activity should, IMO, work. All browser accept it, except for Opera, which never leaves step 21 because play() doesn't accept NETWORK_NO_SOURCE for re-running the resource selection algorithm. That was really my original problem.<br>
<br>Cheers,<br>Silvia.<br><br></div></div>