jplayer / jPlayer

jPlayer : HTML5 Audio & Video for jQuery
http://jplayer.org/
Other
4.6k stars 1.47k forks source link

Calling jPlayer("destroy") does nothing #407

Closed jhernandis closed 6 years ago

jhernandis commented 6 years ago

When I call $('#element').jPlayer("destroy") it's supose that the jPlayer internal method "destroy" will be called, that's right?

If I put a breakpoint on the "destroy" method, at the "this.clearMedia()" line, the execution does'nt stops there. Seems that the internal method it's not called.

Are I making some mistake? Thanks.

MartinDawson commented 6 years ago

What are you wanting to do exactly? Why do you want to destroy the jPlayer?

This method just removes all jPlayer stuff that has been binded so you can create a completely new jPlayer using the constructor again. Are you sure you need this method?

jhernandis commented 6 years ago

I want to change the file music without reloading the entire page. I've tried before to call only the "setMedia", but that does'nt work any.

As I read on some sites, like https://stackoverflow.com/a/10661876, the right way seems to be calling "destroy".

Thanks for your interest.

jhernandis commented 6 years ago

Sorry!!!! I'm wrong, the "setMedia" works fine.... if you set the right filename :(