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
Highlighted
Developer
Posts: 65
Registered: ‎03-20-2013
My Device: Z10(Red Limited Edition)
My Carrier: MY COMPANY

how to play music or video in backgound

Hello all,

          I want to play audio or video's music in background for that i've checked run_when_backgrounded but it can't fulfill my requirment.

So please help me..

 

 

Thank

Ankur

Developer
Posts: 109
Registered: ‎08-23-2012
My Device: Blackberry Z10
My Carrier: TATA DOCOMO

Re: how to play music or video in backgound

Hope this will help you

 

to play the audio in background:

 

MediaPlayer *mp = new MediaPlayer();
mp->setSourceUrl(QUrl("asset:///sound/music.mp3"));

 

i not use for the video so try the same to give the video path may be it will work but i am not sure just try...

Dharmender Singh
Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: how to play music or video in backgound

Make sure you use the Now Playing Connection (https://developer.blackberry.com/cascades/reference/bb__multimedia__nowplayingconnection.html) so your app plays nice with the rest of the multimedia system on the device. It's pretty trivial to connect to, and gives you a lot of neat things for free like notifications to pause/resume the music when phone calls come in.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Developer
Posts: 65
Registered: ‎03-20-2013
My Device: Z10(Red Limited Edition)
My Carrier: MY COMPANY

Re: how to play music or video in backgound

actually i creating an app that will play online video and when we thumbnail the app, the video will be playing in background.

so tell me is it possible or not, if yes? then how......