Search code examples
popupjplayer

Need to stop jPlayer on main page when popup player is initiated


I am using the CirclePlayer and it starts automatically when the particular page is loaded. The player has a popup option and I need to stop the player on the main window and allow only the popup window player to play.

jQuery(document).ready(function($){

    var myCirclePlayer = new CirclePlayer("#jquery_jplayer_1",
    {
        '.$streamtype.': "'.$stream.'",
    }, {
        cssSelectorAncestor: "#cp_container_1",
        swfPath: "'.$libpath.'",
        supplied: "rtmpa, mp3",
        solution: "html, flash",
        wmode: "window",
        volume: 100,
        autoplay: true,
        keyEnabled: true
    });
});

I am using jquery.popupWindow.js from swip.Codylindely.com which looks like this

jQuery('.popplayer').popupWindow({
    height:200,
    width:450,
    top:0,
    left:0
});

and executed with <a href="url" class="popplayer" name="playwindow">Popup</a>

I need an onclick.stop function somewhere but all my efforts have failed. Please let me know how I can achieve this.


Solution

  • Create a function to stop your main jPlayer ... like

    function stopMainPlayer() {
     // Stop Player
    }
    

    then change your popup oppner link like

    <a href="url" class="popplayer" OnClick="stopMainPlayer" name="playwindow">Popup</a>
    

    you can Find the Stop player method from the jplayer hope this will solve your porblum ..