title: Missing cordova.js and Uncaught ReferenceError: Media is not defined
body: <p>So I have created an from scratch app using the latest version of Cordova and followed the instructions from the Cordova API documentation. I am trying to get a very basic mp3 player working on Android, so I have installed the Android platform and installed the Media and Device plugins through the CLI. I am also using the full example of a media player from the API documentation. My code at the moment looks like this:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;meta name="format-detection" content="telephone=no" /&gt;
      &lt;!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 --&gt;
      &lt;meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /&gt;
      &lt;link rel="stylesheet" type="text/css" href="css/index.css" /&gt;
      &lt;title&gt;Hello World&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;script type="text/javascript" src="cordova.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/index.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          app.initialize();
      &lt;/script&gt;
  
      &lt;script type="text/javascript" charset="utf-8"&gt;
  
      // Wait for device API libraries to load
      //
      document.addEventListener("deviceready", onDeviceReady, false);
  
      // device APIs are available
      //
      function onDeviceReady() {
          playAudio("https://ia600808.us.archive.org/21/items/NasaAudioHighlightReels/Launch-Sound_STS-1-Launch.mp3");
      }
  
      // Audio player
      //
      var my_media = null;
      var mediaTimer = null;
  
      // Play audio
      //
      function playAudio(src) {
          // Create Media object from src
          my_media = new Media(src, onSuccess, onError);
  
          // Play audio
          my_media.play();
  
          // Update my_media position every second
          if (mediaTimer == null) {
              mediaTimer = setInterval(function() {
                  // get my_media position
                  my_media.getCurrentPosition(
                      // success callback
                      function(position) {
                          if (position &gt; -1) {
                              setAudioPosition((position) + " sec");
                          }
                      },
                      // error callback
                      function(e) {
                          console.log("Error getting pos=" + e);
                          setAudioPosition("Error: " + e);
                      }
                  );
              }, 1000);
          }
      }
  
      // Pause audio
      //
      function pauseAudio() {
          if (my_media) {
              my_media.pause();
          }
      }
  
      // Stop audio
      //
      function stopAudio() {
          if (my_media) {
              my_media.stop();
          }
          clearInterval(mediaTimer);
          mediaTimer = null;
      }
  
      // onSuccess Callback
      //
      function onSuccess() {
          console.log("playAudio():Audio Success");
      }
  
      // onError Callback
      //
      function onError(error) {
          alert('code: '    + error.code    + '\n' +
                'message: ' + error.message + '\n');
      }
  
      // Set audio position
      //
      function setAudioPosition(position) {
          document.getElementById('audio_position').innerHTML = position;
      }
  
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;a href="#" class="btn large" onclick="playAudio('https://ia600808.us.archive.org/21/items/NasaAudioHighlightReels/Launch-Sound_STS-1-Launch.mp3');"&gt;Play Audio&lt;/a&gt;
      &lt;a href="#" class="btn large" onclick="pauseAudio();"&gt;Pause Playing Audio&lt;/a&gt;
      &lt;a href="#" class="btn large" onclick="stopAudio();"&gt;Stop Playing Audio&lt;/a&gt;
      &lt;p id="audio_position"&gt;&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have build the app in the CLI and then run it with Chrome Developer and I'm getting 2 errors, 1) the cordova.js file cannot be found and 2) Uncaught ReferenceError: Media is not defined.</p>
  
  <p>I know that when the Android platform is added the cordova file is located in the platform_www folder but how do I link to that folder? I've tried coping the cordova.js to the main www folder but every time I do get the messages that are descriped in this link <a href="https://stackoverflow.com/questions/22100000/dreamweaver-cc-and-cordova-js">Dreamweaver CC and cordova.js</a>  </p>
  
  <p>This is driving nuts so if anyone can shed some light on the problem it would be greatly appreciated!</p>