How to distinguish between successful and unsuccessful loading of the html5 media element?

54 views Asked by At

There is a sequence of events that are triggered when audio is being loaded:

  1. loadstart
  2. durationchange ...
  3. canplaythrough

But if something goes wrong then only 1st event loadstart is fired.

The problem is that I cannot distinguish between successful and unsuccessful cases (for example when audio file is not found), because from loadstart event I cannot get any information whether the loading succeeded or not and no events are fired later in failed scenario.

Our JavaScript is GWT-generated.

Please note that I am much more backend than frontend developer so I can miss something evident.

0

There are 0 answers