09-07-2012 04:27 PM
trying to use the navigator_invoke function to open an image or video file.
I think I should be able to do:
char* dummy = 0; navigator_invoke("videos://accounts/1000/shared/vi
deos/cover.mp4", &dummy); or navigator_invoke("photos://accounts/1000/shared/vi deos/cover.png", &dummy);
I also tried:
ver.mp4", &dummy); navigator_invoke("shared/videos/cover.mp4", &dummy); navigator_invoke("//accounts/1000/shared/videos/co ver.png", &dummy); navigator_invoke("shared/videos/cover.png", &dummy);
Always the same result. For images, it opens the image app but not the image I specified, just the default Pictures app with a folder for Camera, one for All Pictures and one for Wallpaper.
For videos, it tries to open the video player but gives a popup:
Cannot open the file. Please check the file permissions and try again.
If I put in a rubbish name I get the same error so I'm sure its just me not getting the string format right. Does anyone have an example for opening a video in the shared folder?
09-10-2012 10:45 AM
Hi there, welcome to the forums!
Have you looked at the Media example on the samples page?
Are you using the simulator or the actual device?
09-10-2012 12:01 PM
thanks for the welcome
I did look at all the examples, yes. The Multimedia examples focus on using the mmr (Multimedia Renderer) but as I'm using Qt, if I use mmr to play a video I can hear it but can't see the video, its stuck behind a black window (there are other threads discussing this but no solution).
So I thought a easier option for me was to ask Playbook to manage the playback of the video, using navigator_invoke.
I could not see any sample using navigator_invoke.
Here the SDK documentation says I can call navigator_invoke passing
videos://file_URL - Opens the videos application and plays the specified file
But, as I said already, I can't get this to work; if you can provide a one line example showing how to call this API for a file in the shared folder I'd really appreciate it
09-11-2012 02:27 AM
did you try your example? It just crashes for me, do I need to initialiate the char err?
char *err = (char *) malloc(sizeof(char) * 1000); navigator_invoke("videos://shared.mp4", &err); printf(err);
But I get garbage out
Can you please try your example and advise.
Just to go back to my original question, my videos are in a shared folder. I can't just put a file in the shared folder (it comes up as Y: on my PC), files have to go in folders on that drive. So I can never have shared.mp4 in the top level folder, does it not have to go in a folder like videos?
thanks for you help
09-11-2012 03:54 PM
I really like the playbook. I have a couple of apps in Apples App Store and I'd love to code for the playbook. But...
I posted a question 5 days ago asking for someone to confirm the format of a published api...nothing. Isit just me? How do you guys code when APIs are half documented and don't seem to work, and little to no support on this forum from RIM.
09-11-2012 04:23 PM
Unfortunately my focus of expertise is the BB10 platform -
In your bar-descriptor.xml file, have you tried adding/uncommeting the following action?
<!-- <action>access_shared</action> -->
This wil lallow you to access the shared section on the device;
Let me know if this helps!
09-11-2012 04:37 PM
yep, I have that in my bar-descriptor.xml. So yu recommend I give up on Navtive and move to BB10?
I currently have a playbook so I can debug using it. But without a BB10 Alpha device, trying to get the BB10 simulator to work properly is a discussion for another thread