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

Player.destroy() throws exception when Audio is disabled. #179

Open
shbatm opened this issue Jul 5, 2017 · 3 comments
Open

Player.destroy() throws exception when Audio is disabled. #179

shbatm opened this issue Jul 5, 2017 · 3 comments

Comments

@shbatm
Copy link

shbatm commented Jul 5, 2017

When calling Player.destroy() on a player with the audio: false setting an exception is thrown:

Uncaught TypeError: Cannot read property 'destroy' of undefined
    at Player.destroy (jsmpeg.min.js:formatted:264)

It appears that because audio: false is used, this.audioOut is undefined and therefore this.audioOut.destroy() fails when called in Player.prototype.destroy().

@AttilaSATAN
Copy link

I've the same issue and I can confirm that @shbatm 's findings. I've just patched and placed a condition and requested a pull #181

@stephane-ruhlmann
Copy link

@AttilaSATAN Any news on this pull request?

@calary
Copy link

calary commented Nov 29, 2017

You can just surround the code in a try-catch block

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

4 participants