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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Super Contributor
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook
My Carrier: NA
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
Developer
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

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
Super Contributor
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook
My Carrier: NA

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
Highlighted
Developer
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

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
Retired
Posts: 127
Registered: ‎02-27-2012
My Device: Bold
My Carrier: Rogers

Re: Involke Media Player

Hi @

Application Development Consultant | Developer Relations

BlackBerry
@surashid

Retired
Posts: 127
Registered: ‎02-27-2012
My Device: Bold
My Carrier: Rogers

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