title: playing audio sounds in Cordova application
body: <p>I'm using Cordova media plugin for playing audio sound in my mobile application 
  I tried many codes but I didn't figure out what I'm doing wrong at the bottom I put two piece of code that I tried them</p>
  
  <p>the first code (js code in a separate file)</p>
  
  <pre><code>   var app = {
      initialize: function() {
          this.bindEvents();
      },
      bindEvents: function() {
          document.addEventListener('deviceready', this.onDeviceReady, false);
      },
      onDeviceReady: function() {
  
  
          var myMedia = new Media("../sounds/clapping.mp3");
          myMedia.play();
  
      }
  };
  
  app.initialize();
  </code></pre>
  
  <p>the second code  (js code in a script tag) : </p>
  
  <pre><code>     document.addEventListener("deviceready", function(){
  
     var myMedia = null;
      function playAudio() {
  
      var src = "sounds/clapping.mp3";
  
      if(myMedia === null) {
      myMedia = new Media(src, onSuccess, onError);
  
      function onSuccess() {
      console.log("playAudio Success");
      }
  
      function onError(error) {
      console.log("playAudio Error: " + error.code);
      }
  
      }
  
      myMedia.play();
      }
  
      document.getElementById("playAudio").addEventListener("click", playAudio);
      });
  </code></pre>
  
  <p>with a button : </p>
  
  <pre><code>&lt;button id ="playAudio"&gt;PLAY&lt;/button&gt;
  </code></pre>
  
  <p>How can I solve this problem ?</p>