anteriovieira / vue-youtube

A simple component for a powerful API. vue-youtube provides a simple layer for you to use your imagination while over the YouTube IFrame Player API.
MIT License
340 stars 56 forks source link

Error event returns event target, not error code #32

Open nwittwer opened 5 years ago

nwittwer commented 5 years ago

When the onError event fires, I would like to access the error code, however this plugin currently returns only the event.target, which—as far as I can tell—is only the YouTube player object without any internal error logs.

The YouTube API says that the error code is available via event.data.

This plugin (playerError()): https://github.com/anteriovieira/vue-youtube/blob/master/src/vue-youtube.js#L68 YouTube API (onError()): https://developers.google.com/youtube/iframe_api_reference#onError

lawrence615 commented 2 years ago

@nwittwer did you ever get a solution to this?

nwittwer commented 2 years ago

@lawrence615 Haven't tried in a while, but after briefly looking again in this repo, it looks like it still emits event.target, so I assume it still would not solve this.

https://github.com/anteriovieira/vue-youtube/blob/585299c0aa26d1201f382f069647ad09f0e2f90f/src/vue-youtube.js#L71-L73

lawrence615 commented 2 years ago

@lawrence615 Haven't tried in a while, but after briefly looking again in this repo, it looks like it still emits event.target, so I assume it still would not solve this.

https://github.com/anteriovieira/vue-youtube/blob/585299c0aa26d1201f382f069647ad09f0e2f90f/src/vue-youtube.js#L71-L73

@nwittwer Yes I agree with you.

What I noticed is that the event has value only when there's an error.

Hence, all errors will be captured and treated the same way.