blackberry / WebWorks-API-Docs

BlackBerry WebWorks API Documentation
66 stars 47 forks source link

Code example in Mediamicrophone only works in PlayBook #252

Open miamon opened 13 years ago

miamon commented 13 years ago

On the example located here http://www.blackberry.com/developers/docs/webworks/api/blackberry.media.microphone.html are using blackberry.io.dir.appDirs.shared.music.path, and blackberry.io.dir.appDirs are only available in PlayBook api.

I think it's better to specify this on the example, and coment other code for Smartphone, something like:

var fileName = document.getElementById('filename').value;

//For BlackBerry PlayBook // NOTE: access to shared folder requires "access_shared" permission on config.xml var filePath =blackberry.io.dir.appDirs.shared.music.path + fileName;

//For Smartphone BlackBerry var filePath = 'file:///SDCard/' + fileName;

//For BlackBerry PlayBook and Smartphone BlackBerry mic.record(filePath, testSuccess, testError);

jeffheifetz commented 13 years ago

Or better yet use http://www.blackberry.com/developers/docs/webworks/api/blackberry.system.html#.model to decide which file path to use