Skip to content Skip to sidebar Skip to footer

Can't Play Audio In Android Device

I want to make something like this : I run my app on local

Solution 1:

See this question for an answer: IBM Worklight 6.1 - Unable to play a local media file using Cordova

Copy-paste of my answer:

... for playing a local media file, you need to provide the full path to the media file's location where it'll be in the generated Android project. For example, if you create a common\audio folder in the Worklight application and place a .mp3 file in it, you need to use the following path (in the HTML or JavaScript, or however you'd like...):

<ahref="#"onclick="playAudio('/android_asset/www/default/audio/myMediaFile.mp3');">Play Audio</a>

Sample project: Android Cordova Media API

Post a Comment for "Can't Play Audio In Android Device"