Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error event returns event target, not error code #32

Open
nwittwer opened this issue Jun 16, 2019 · 3 comments
Open

Error event returns event target, not error code #32

nwittwer opened this issue Jun 16, 2019 · 3 comments

Comments

@nwittwer
Copy link

nwittwer commented Jun 16, 2019

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

@nwittwer nwittwer changed the title onError returns event target, not error code Error event returns event target, not error code Jun 16, 2019
@lawrence615
Copy link

@nwittwer did you ever get a solution to this?

@nwittwer
Copy link
Author

@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.

playerError (e) {
this.$emit('error', e.target)
},

@lawrence615
Copy link

@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.

playerError (e) {
this.$emit('error', e.target)
},

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants