Android phone does not produce sound using cordova phone plugin & does not give error message
<p>I am using the ionic framework to create an app. I would like to play a sound so I used <a href="https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-media/" rel="nofollow">https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-media/</a>
.
This is my piece of code used to play the sound:</p>

<pre><code>var my_media = new Media('/android/assets/www/audio/National Anthem.mp3',
        // success callback
        function () { console.log("playAudio():Audio Success"); },
        // error callback
        function (err) {console.dir("playAudio():Audio Error: " + err); }
    );
     my_media.play(); 
</code></pre>

<p>Unfortunately its not playing and the error message given is:</p>

<pre><code>playAudio():Audio Error: [object Object]
</code></pre>

<p>In which I cannot view the object on the chrome console!</p>

<p>If I replace <code>var my_media = new Media(..</code> with <code>var my_media =$cordovaMedia.newMedia(...</code> I dont get any message at all on the console. My code is placed in <code>$ionicPlatform.ready(function()..</code> so I know for sure that the plugin is ready before using it. Any sugesstions? </p>