Plyr: Get error details on error event

Created on 24 Apr 2017  路  6Comments  路  Source: sampotts/plyr

Expected behaviour

Get the error details on the error event (for instance a HTTP error 401), by doing :

instance.on("error", function (event) {
    var error = event.detail.plyr.getContainer().error;
    console.error("plyr error", error);
});

Actual behaviour

Got undefined

Environment

  • Browser: Chromium
  • Version: 57
  • Operating System: Ubuntu
  • Version: 16.04

Players affected:

  • [ ] HTML5 Video
  • [x] HTML5 Audio
  • [ ] YouTube
  • [ ] Vimeo

Steps to reproduce

  • go to the page containing the audio player
  • remove website token from browser
  • try to play sound
  • 401 in the console

Hello,

I'm looking for a way to get the details of an error using the error event. I tried to look for an error object in the container but didn't find anything...
Thank you for your work and for your help!

Bug

Most helpful comment

Sorry, I'll work on improving this.

All 6 comments

i can't figure this out either. the readme says "The element's error attribute contains more information," but 1) it's not very clear what "the element" is, and 2) i can't find an error attribute on anything that might be "the element" (the error object, the player, etc.).

Sorry, I'll work on improving this.

Any progress on this? I'm not sure if I'm having the exact same issue as @vbourgeois, for me the event.detail is always undefined for any event I'm attaching to.

this.$video.on('play', (event) => {
    console.debug(event);       // event object has detail attribute object but it is undefined
});

See the other issue related to error handling for a more updated response. Sorry I鈥檓 on my phone so it鈥檚 hard to search.

Is it possible to link to the fix - i'm having a hell of time searching for the correct ticket. Sorry for being a bother.

any update on this? :D i would love to be able to check out the error event for debugging.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thang-nm picture thang-nm  路  4Comments

frumbert picture frumbert  路  3Comments

sparkktv picture sparkktv  路  4Comments

ahmadshc picture ahmadshc  路  4Comments

Antonio-Laguna picture Antonio-Laguna  路  3Comments