suterma / vue-peaks

A Vue wrapper around the bbc/peaks.js audio waveform UI component
https://suterma.github.io/vue-peaks/
GNU Lesser General Public License v3.0
11 stars 1 forks source link

Error reporting for media-element related errors does not work in simple mode #18

Open suterma opened 1 year ago

suterma commented 1 year ago

When using the simple mode, non-existing URL's or non-responding servers do not get properly reported by the internally created media element.

The exact reason is unknown, but both trying to handle the error property or the error event on the referenced media element does not work, when it's created in the simple mode.

Code such as:

// in function createPeaksInstance
//....
  // handle an already existing and future errors on the media element, e.g. a missing response
  if (mediaElement?.error) {
    handleMediaError(mediaElement.error);
  }
  if (mediaElement) {
    mediaElement?.addEventListener('error', (error) => {
      handleError(error.error);
    });
  }

does only work for slot mode and external mode.

suterma commented 1 year ago

In a future release, the simple mode should probably be removed. The slot mode is very simple and straightforward to use anyway.