If you're using the PhoneGap Media
plugin, you don't really need to provide the absolute path to the media file in iOS
. A relative path suffices as demonstrated in the Media Plugin docs
. You can find a sample solution demonstrating how to play an audio file in an iOS
device attached in the How to Play a Small Sound File
, on the other hand, you need to provide the path to the file using the specific Android prefix
previously described in this thread. This means that if you need your app to run in both iOS
, you can use the following code:
// Audio player
devicePlatform = device.platform;
|| devicePlatform ===
Media(path, onSuccess, onError);
However, please note that the above code snippet takes advantage of the Device core plug-in
and you need to make sure it is enabled in the AppBuilder
project before using it to check the platform of the device.
I hope this information helps.
Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!