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

Native Development

Reply
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook
Accepted Solution

Involke Media Player

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?

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900

Re: Involke Media Player

[ Edited ]

You can bundle mediaplayer in the qml as attachedObject and it won't show.

 

onClicked: {
                    myPlayer.setSourceUrl("asset:///klick1.wav");
                    myPlayer.play();
                }

                           :

                         //ignore codes here

                           :

attachedObjects: [
            // Create the ComponentDefinition that represents the custom
           
            MediaPlayer {
                id: myPlayer
                // sourceUrl: < Set in the Button onClicked signal handler >
            }
        ]




p(^_^)q
Good good study, day day up
Please use plain text.
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook

Re: Involke Media Player

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?

 

Tahnks

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900

Re: Involke Media Player

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.




p(^_^)q
Good good study, day day up
Please use plain text.
BlackBerry Development Advisor (Retired)
s_rashid
Posts: 127
Registered: ‎02-27-2012
My Device: Bold

Re: Involke Media Player

Hi @

Application Development Consultant | Developer Relations

BlackBerry
@surashid

Please use plain text.
BlackBerry Development Advisor (Retired)
s_rashid
Posts: 127
Registered: ‎02-27-2012
My Device: Bold

Re: Involke Media Player

Forgot to mention: The core media player card app, *should* allow you to play music when the app is minimized, similar to what the core music player app does (you should double check still). However, if you invoke the card app with videos, then it definitely pauses when the app is minimized, as per the UX decision.

Cheers,
Rashid
Please use plain text.