0

Issue: Using the media module, I can play back an mp3 just fine in the base Ripple Nexus emulator, but on my android device I do not get any sound. It doesn't look like it is throwing an error.

Anyone have a similar issue? I'm pretty new to Cordova. This was my hello world example. I spiced it up by downloading the media module and adding this snippet into the index.js file-

 var element = document.getElementById("deviceready");
    element.innerHTML = 'Play Message';
    element.className += ' ready';
    element.onclick = function () {

        var media = new Media("images/test.mp3", null, null);
        media.play();

    } 

Thanks for your time.

infocyde
  • 4,140
  • 2
  • 25
  • 36

1 Answers1

0

Figured it out. You have to prepend the path /android_asset/www/ to your media URL for android devices I guess. Would be nice if Cordova took care of that for you.

These post where helpful.

Ionic/Cordova app plays sound in emulator but not on Android device

http://www.raymondcamden.com/2014/06/23/Cordova-Media-API-Example/

infocyde
  • 4,140
  • 2
  • 25
  • 36