Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Highlighted
Developer
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)
Accepted Solution

Playback of MP3s from shared folder

Hi there,

 

I got a question about accessing content from the shared folder. I use the following code for background sound playback:

 

var audio = new Audio(filepath)
audio.play()

This command works for: filepath set to 'audio/monkey.mp3', but does not work for 'file:///accounts/1000/shared/music/monkey.mp3' (or '/accounts/1000/shared/music/monkey.mp3'). I copied this file in this folder on my Dev Alpha (and additionally bundled it with my app). The directory was returned from "invokeFilePicker".

 

I need this functionality in order to let the user choose custom music from the device's library.

 

Using the remote debugger (aka web inspector) wasn't particularly helpful as both requests are shown as status "Success" in the "Network" tab.

 

Here are the possibly interesting lines from my config.xml, in case something is wrong with my permissions:

 

[...]
<rim:permit>access_shared</rim:permit> 
[...]
<access uri="*" subdomains="true"/>
[...]
<feature id="blackberry.io.file" />
<feature id="blackberry.utils" />
[...]

 Do you have any ideas?

- - -
My approved apps @ App World
Developer
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

Re: Playback of MP3s from shared folder

Note to self: do not post questions in the middle of the night after long working hours...

 

It really was an permissions issue, but I did forget to encapsulate my permissions like this:

<rim:permissions>
    <rim:permit>access_shared</rim:permit>
</rim:permissions>

 It works just fine now.

- - -
My approved apps @ App World