play() sometimes doesn't do anything now that load() is async

This is related to http://www.w3.org/Bugs/Public/show_bug.cgi?id=6353


Consider the following:

   <video id=v><script>
    v = document.getElementById('v');
    v.src = 'test';
    v.play();
   </script>

When the video start tag is parsed, load() is implicitly invoked and when the method returns (meaning scripts can potentially run before the next steps in load() are run, AIUI) networkState is NETWORK_LOADING.

When setting the src attribute, load() will not be implicitly invoked again because networkState is not NETWORK_EMPTY.

When play() is invoked, load() will still not be implicitly invoked again because networkState is not NETWORK_EMPTY.

So the list of candidates will be empty and nothing will play. This is not what one would expect. (If you do an explicit load() before play() it works as expected.)


We haven't found a nice way to fix this, yet. Maybe play() should be async and set a flag that some step at the end of the load() algorithm will look at and, if set, start to play the resource, or something.

-- 
Simon Pieters
Opera Software

Received on Tuesday, 13 January 2009 15:21:25 UTC