Re: Media elements may never load, may load the wrong source, etc

On Sun, 26 Jul 2009 05:05:42 +0200, Ian Hickson <ian@hixie.ch> wrote:

> On Wed, 8 Jul 2009, Philip Jagenstedt wrote:
>>
>> I'd prefer wording requiring the resource selection algorithm to
>> continue the "asynchronous" steps once the triggering script has
>> finished, similar to the old wording for the implicit load(): "the user
>> agent must implicitly invoke the load() method on the media element as
>> soon as all other scripts have finished executing". There's no element
>> of chance involved as far as I can see. If this could help remove the
>> different handling of src/source with two different waiting states and
>> ugliness, all the better.
>
> "as soon as all other scripts have finished executing" is vague to the
> point of not being testable, sadly. But I've taken that idea and recast
> the entire algorithm in a way that gets you the same effect.
>
> Basically now it waits until the current task has finished, and then  
> looks
> to see if there's a src="" or <source>, and if there is, it switches to
> the appropriate mode and processes that src="" or <source>
> (asynchronously). For <source>, if that one fails, it waits until the  
> next
> time the event loop has finished, and then tries the next one.

Thanks, this fixes the biggest issue (predictability) and better matches  
the constraints of actual implementation.

Pretty much the only testable difference is that immediately after the  
resource selection algorithm returns (via load/pause/play) networkState is  
NETWORK_NO_SOURCE, whereas it was previously NETWORK_LOADING. This has the  
side-effect that calling load() twice no longer fires an abort event, as  
the condition is "If the media element's networkState is set to  
NETWORK_LOADING or NETWORK_IDLE". This is all fine (and emptied still  
fires).

Spelling: "then jump o the waiting step below"

-- 
Philip Jägenstedt
Core Developer
Opera Software

Received on Monday, 27 July 2009 11:23:21 UTC