|
This should be simple, but I can't find a way to send a "stop" command to the player. Can anyone help? |
|
Yeah, that's the way a human would stop it. I want to stop it from a JavaScript so I can control playback from another element on the page. |
|
I got it working, not sure if it's the "best" way. I modified the jquery.mb.miniPlayer.js script to include a public method that will return an object reference to the player with a specific ID. To do this, I added the private function "getPlayer" after the changeFile function, as follows (don't forget to add a comma after the closing "}" in the changeFile function): getPlayer:function() { var ID= $(this).attr("id"); var $player=$("#"+"MP_"+ID); return $player; } Then I added the public method "mb_getPlayer" to the end of the file, as follows: $.fn.mb_getPlayer = $.mbMiniPlayer.getPlayer; Now I can get a reference to any player object in my own JavaScript code by calling: var myPlayer = $('#m1').mb_getPlayer(); //m1 is the ID of my player Finally, I can use the "myPlayer" object to call any of the generic "jPlayer" methods, including "pause", as follows: myPlayer.jPlayer("pause"); If anyone has a better idea, let me know. |
|
In the latest gitHub release there are some new public method that let you control the player via javascript:
You can use them as follow:
Bye, Matteo |


