Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

Add .destroy() methods to Wrappers #434

Open
jtomaszewski opened this issue Mar 4, 2015 · 1 comment
Open

Add .destroy() methods to Wrappers #434

jtomaszewski opened this issue Mar 4, 2015 · 1 comment

Comments

@jtomaszewski
Copy link

Currently we have function destroyPlayer() { ... } methods in every wrapper like soundcloud/youtube, but they are hidden in private scope and can't be called manually. Thus, if I want to f.e. destroy my soundcloud wrapper and to create youtube wrapper, I will receive Uncaught TypeError: Cannot read property 'postMessage' of null errors, because callbacks haven't been removed (similar to #427).

Simple adding of self.destroy = destroyPlayer; line to popcorn.HTMLYouTubeVideoElement.js and popcorn.HTMLSoundCloudAudioElement.js solves the problem.

I can make a pull request for that, but I'd want to be sure, that it's the best way to do it?

jtomaszewski added a commit to jtomaszewski/popcorn-js that referenced this issue Jun 11, 2015
@jtomaszewski
Copy link
Author

I added .destroy() method to all media wrappers in jtomaszewski@3e44144 .

IMHO it's okay to merge. Optionally, we could add a common test case for all wrappers.

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

No branches or pull requests

1 participant