title: jplayer - Uncaught TypeError: Cannot read property 'play' of undefined
body: <p>i´m using the jquery-jplayer plugin from getshopped.org. I´ve asked the question at their forums but sadly it seems impossible to get any help there.
  So my problem is that i want to pause all instances of jplayer when one is started, via the "pauseOthers" Method. Doesn´t work though... Any help would be very much appreciated! Here´s my code:</p>
  
  <pre><code>&lt;script type='text/javascript'&gt;
  jQuery(document).ready(function($){
      // Local copy of jQuery selectors, for performance.
      //array of players and int variables for uniquely identifying each player                   
      var jPlayer_array = $(".jquery_jplayer");
      var playerID;
      var fileID;
      var jpPlayTime = new Array();
      var jpTotalTime= new Array();
      var song = new Array();
      &lt;?php
  if(isset($_SESSION['jplayer_plugin_ids'])){
      foreach((array)$_SESSION['jplayer_plugin_ids'] as $fileid){
          $file_data = get_post($fileid);
          $mp3_path= WPSC_PREVIEW_URL."".addslashes($file_data-&gt;post_title)."";
          if(!empty($file_data)){?&gt;
          jpPlayTime_&lt;?php echo $fileid; ?&gt; = $("#jplayer_play_time_&lt;?php echo $fileid; ?&gt;");
          jpTotalTime_&lt;?php echo $fileid; ?&gt; = $("#jplayer_total_time_&lt;?php echo $fileid; ?&gt;");
  
  
          //Console: Uncaught TypeError: Cannot read property 'play' of undefined
          $('#jquery_jplayer_&lt;?php echo $fileid; ?&gt;').bind($.jPlayer.event.play, function() { 
                              $(this).jPlayer("pauseOthers");}); 
  
  
  
  
          $('#jquery_jplayer_&lt;?php echo $fileid; ?&gt;').jPlayer({
                  ready: function () {
                      this.setFile('&lt;?php echo $mp3_path; ?&gt;');
                  },
                  swfPath: '&lt;?php echo WP_CONTENT_URL."/plugins/jPlayerPlugin/js"; ?&gt;',
                  volume: 50,
                  customCssIds: true
              })
  
              .jPlayer( "cssId", "play", "jplayer_play_&lt;?php echo $fileid; ?&gt;" )
              .jPlayer( "cssId", "pause", "jplayer_pause_&lt;?php echo $fileid; ?&gt;" )
              .jPlayer( "cssId", "loadBar", "jplayer_load_bar_&lt;?php echo $fileid; ?&gt;")
              .jPlayer( "cssId", "playBar", "jplayer_play_bar_&lt;?php echo $fileid; ?&gt;")
              .jPlayer( "cssId", "volumeMin", "jplayer_volume_min_&lt;?php echo $fileid; ?&gt;")
              .jPlayer( "cssId", "volumeMax", "jplayer_volume_max_&lt;?php echo $fileid; ?&gt;")
              .jPlayer( "cssId", "volumeBar", "jplayer_volume_bar_&lt;?php echo $fileid; ?&gt;")
              .jPlayer( "cssId", "volumeBarValue", "jplayer_volume_bar_value_&lt;?php echo $fileid; ?&gt;")
              .jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
                  jpPlayTime_&lt;?php echo $fileid; ?&gt;.text($.jPlayer.convertTime(playedTime));
                  jpTotalTime_&lt;?php echo $fileid; ?&gt;.text($.jPlayer.convertTime(totalTime));
              })
              .jPlayer("onSoundComplete", function() {
                  //COMMENT THIS LINE OUT IF YOU WANT THE TRACK TO LOOP
                  //this.element.jPlayer("play");
              });
          &lt;?php
          }
      }
  }
  </code></pre>
  
  <p>?></p>
  
  <pre><code>});
  &lt;/script&gt;
  </code></pre>