This is a migrated thread and some comments may be shown as answers.

Cannot open local audio file

1 Answer 81 Views
AppBuilder Windows client
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mathieu
Top achievements
Rank 1
Mathieu asked on 18 Mar 2014, 11:23 PM
Hello,
I want to develop some kind of custom music player for my iOS (jailbreaked) device but I'm stuck at an early stage of developpement: I can't get to play local files stored outside of my application's directory.

So far, I'm doing tests using the sample-media-player code provided on GitHub here: https://github.com/Icenium/sample-media-player, changing only the source of the media to open.

When opening file from the web (as shown in the example) and from a directory within my application (the mp3 file being loaded with the app) no problem, it works.
But when I try to open a file from another directory on the device, I get a type 1 error with message "Cannot use audio file from resource 'my_custom_path.mp3'".

The point here would be to use another app to send music on the device and create a player that will then open music from the directory where the other app has stored the files.

I've triple-checked my spelling (especially the long alphanumerical name of the directory of the other app in the path), verified that the file is indeed on the device and tried with a "file://" before my path, nothing has allowed me to open files from another app.

Please let me how I could do that.
Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 21 Mar 2014, 03:16 PM
Hello Mathieu,

Thank you for contacting us.

Unfortunately, it seems as this is a limitation in the Cordova Media API.

What you can try is to copy the audio file in the apps local storage using the Cordova File API. Or, if this does not succeed, in your other app you can copy/move the audio files to the music player app local storage. The second approach is described here.

I hope this helps.

Regards,
Kaloyan
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET. Seats are limited.

 
Tags
AppBuilder Windows client
Asked by
Mathieu
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or