title: phonegap: Uncaught ReferenceError: Media is not defined
body: <p>I'm trying to play sounds in my phonegap application.</p>
  
  <p>The function I use to do so looks as follows:</p>
  
  <pre><code>function playAudio(src) {
     src = "media/sounds/" + src; //go to sound folder always
  
     if (device.platform == 'Android') {
          src = '/android_asset/www/' + src;  // Android needs the search path explicitly specified
     }
  
      var mediaRes = new Media(src,
          function onSuccess() {
              mediaRes.release(); // release the media resource once finished playing
          },
          function onError(e){
              alert("error playing sound: " + JSON.stringify(e) + "\n src: " + src);
          });
  
          mediaRes.play(); // the actual playing
  }
  </code></pre>
  
  <p>The strange thing is, if I set up an app which only consists of the index.html file that has javascript in its body part, the sound works.</p>
  
  <p>However, it does not work when I use the menu a colleague coded. In that case, I get </p>
  
  <pre><code>Uncaught ReferenceError: Media is not defined
  </code></pre>
  
  <p>To switch between the two setups (the simple, working one and the menu one), I just exchange the "www" folder that contains the files. Thus, cordova-plugin-media is available for both in the same manner.
  For the not-working one, cordova.js and phonegap.js are definitely available (I included a custom alert function in those files to check).</p>
  
  <p>Additionally, the sound playing is executed after "deviceready" has been fired.</p>
  
  <p>Does anyone have suggestions where to continue debugging? Completely redesigning the menu would probably work, but I want to avoid that if possible in any way. </p>