title: cordova-plugin-media callback methods
body: <p>I am using cordova-media-plugin 1.0.1. in an Ionic mobile app.  I am using the plugin to play the audio file.</p>
  
  <p>I am able to get it to play using:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>var media = $cordovaMedia.newMedia(fileToPlay,
             // success callback
            mediaSuccess,
  
            // error callback
            mediaFailure,
  
            // status callback
            mediaStatus
          );</code></pre>
  </div>
  </div>
  </p>
  
  <p>I can then call media.play() at it plays the file.</p>
  
  <p>However, the callbacks never seem to execute.  I have them defined as:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> function mediaSuccess () {
        console.log("Successfully finished task.");
      }
        
      function mediaFailure (err) {
        console.log("An error occurred: " + err.code);
      }
  
      function mediaStatus (status) {
        console.log("A status change occurred: " + status.code);
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>But they are never called.   However, it my console, I am seeing logging from the player itself as it starts and stops playing:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Will attempt to use file resource '//var/mobile/Containers/Data/Application/931BFA01-CDA4-43CD-BC16-7FB6A64305DC/Library/NoCloud/DateTime-1446772191539audio_007.wav'
  
  Playing audio sample '//var/mobile/Containers/Data/Application/931BFA01-CDA4-43CD-BC16-7FB6A64305DC/Library/NoCloud/DateTime-1446772191539audio_007.wav'
  
  Stopped playing audio sample '//var/mobile/Containers/Data/Application/931BFA01-CDA4-43CD-BC16-7FB6A64305DC/Library/NoCloud/DateTime-1446772191539audio_007.wav'</code></pre>
  </div>
  </div>
  </p>
  
  <p>These logging events are going to the console, but they are NOT in my code so they must be coming from the media object.</p>
  
  <p>I need to get the status change and/or success call backs as I need to update the model to enable the play but again when the clip finishes play.</p>
  
  <p>Any thoughts?</p>