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

Destroy/Restore YouTube not working? #272

Closed
danielsarin opened this issue Jun 10, 2016 · 2 comments
Closed

Destroy/Restore YouTube not working? #272

danielsarin opened this issue Jun 10, 2016 · 2 comments
Assignees
Labels

Comments

@danielsarin
Copy link
Contributor

danielsarin commented Jun 10, 2016

Hi,

I'm trying to destroy a YouTube instance and then restore it, but it doesn't seem to work. The docs do not mention that these methods wouldn't work for YouTube as well.

My HTML is

<div data-type="youtube" data-video-id="12345"></div>

and js

videos = plyr.setup({});

In the docs it says

Destroys the plyr UI and any media event listeners, effectively restoring to the previous state before setup() was called.

When I call videos[0].plyr.destroy()it doesn't restore the original HTML, though I don't know if it should.

But when I call videos[0].plyr.restore() it gives me an error:

Uncaught TypeError: Cannot set property 'buffered' of undefined

I made a fiddle: https://jsfiddle.net/f1hc53cq/2/

Is there something I'm doing wrong?

Thanks for any help,
Daniel

@sampotts sampotts self-assigned this Jul 10, 2016
@sampotts sampotts added the Bug label Jul 10, 2016
@sampotts
Copy link
Owner

sampotts commented Aug 21, 2016

This should be fixed in v2.0.0 - could you give it a go? Bear in mind there were also several breaking changes so check the changelog

@danielsarin
Copy link
Contributor Author

It seems to work now, thanks!

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

No branches or pull requests

2 participants