[Bug 12982] <video> canplay and canplaythrough should only fire once, when the new readyState is HAVE_FUTURE_DATA and HAVE_ENOUGH_DATA for the first time, respectively.

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12982

--- Comment #3 from Rick Waldron <waldron.rick@gmail.com> 2011-06-17 21:32:03 UTC ---
Derived from here: https://bugzilla.mozilla.org/show_bug.cgi?id=664842#c0

If an event handler is attached to the "canplaythrough" event ( to take
advantage of HAVE_ENOUGH_DATA state) in which the handler contains logic that
will change thee currentTime, the "canplaythrough" event will be fired again.
At this point the media element will become locked up as the event and handler
enter an infinite feedback loop.

eg.

var vid = document.getElementById("video");

vid.addEventListener( "canplaythrough", function() {
  // This line causes it:
  vid.currentTime = 3;

}, false );

Live demo here: http://jsfiddle.net/rwaldron/42r3u/6/

This can only be reproduced in Firefox 4+ as this is the only browser that
implements the spec correctly.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 17 June 2011 21:32:10 UTC