02-04-2013 12:39 PM
I want to play a music file in my app.
I can load the file and play it using Media Player. But would it be better to involke the media player an dplay if through that. If I do that do I have to have the Media Player on screen or can I hide it again and keep the music playing?
Can I do this on the Dev Alpha too?
Solved! Go to Solution.
02-04-2013 01:53 PM - edited 02-04-2013 01:54 PM
You can bundle mediaplayer in the qml as attachedObject and it won't show.
//ignore codes here
// Create the ComponentDefinition that represents the custom
// sourceUrl: < Set in the Button onClicked signal handler >
02-04-2013 01:56 PM
How can I do the same thing in C++.
Will it show when I wnat it to show, ie. when I want to let the user scrub ahead in the track?
02-04-2013 02:01 PM
I think that you can refer with the sample app in the native sdk development. There is an videowindow project. You will see how to stream or play audio/video.
08-01-2013 02:28 PM
Not sure if you already had this resolved but answering just in case:
For apps where the primary use case is multimedia (audio/video) consumption, you should be making your own media player Page with your own UI controls (while still following the BB10 UI guidelines and keeping it similar to the core Music and Video apps which are bundled - since users get used to those features). There are actually quite a few simple Cascades sample apps which use Cascades MediaPlayer API.
But yes, if it is a simple part of the app and you don't have enough time to make your own media player Page, you can just invoke the core Media Player card app and it is definitely better than forcing the user to download/save the file to play it through the core Music app. The app invocation would be like navigating to a new Page (so user can swipe/peek/press back button anytime, just like any other NavigationPane Page). The invocation code is like any other invocation.
But note that since it would be a different app that you are invoking, you won't be able to change any of the UI components in Media Player card app.
Application Development Consultant | Developer Relations
08-01-2013 02:29 PM