[html5] HTMLMediaElement error state

Nathan Ziarek nziarek at gmail.com
Wed Jan 13 06:05:15 PST 2010


>> In my practical, real-world usage, it seems that if no suitable
>> <source> is found, the error code and the error event should bubble up
>> (I'm probably not using that terminology correctly) to the parent
>> <video> element. Without that, I do not see a way to determine if the
>> UA has determined there is nothing for it to display.
>
> The error event on <source> doesn't bubble. You can set an event listener on
> the last <source>. If the last <source> fails, then you know that all others
> have also failed, since they are tried in order.

That is precisely what I was looking for but wasn't seeing. I was
dreading all the loops to check to see if sources had failed or not
instead of being able to check the one <video> element. I hadn't
considered that the media element is still alive even after failing to
load a source -- I thought that was the reason for the load() method.

In any case, what you say makes sense. I appreciate the guidance.

Best,
Nathan



More information about the Help mailing list