Open jtomaszewski opened 9 years ago
I added .destroy()
method to all media wrappers in https://github.com/jtomaszewski/popcorn-js/commit/3e44144bc34c5384162bd7935e85d85bb5f0cb49 .
IMHO it's okay to merge. Optionally, we could add a common test case for all wrappers.
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 receiveUncaught TypeError: Cannot read property 'postMessage' of null
errors, because callbacks haven't been removed (similar to #427).Simple adding of
self.destroy = destroyPlayer;
line topopcorn.HTMLYouTubeVideoElement.js
andpopcorn.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?