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

Java Development

Forums Advisor I
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10
Accepted Solution

Playing audio and video in one player?


Is it possible to play audio and video is the same player??

If i give the video url video will play and same for sound??

Posts: 121
Registered: ‎05-31-2012
My Device: 9900
My Carrier: Airtel

Re: Playing audio and video in one player?

I think you can do a work arround as follows--


In both cases you create the plyaer in same way--


Player player = Manager.createPlayer(urlToPla);


But in case of video we get the VideoControl and get the associated field to display .


VideoControl videoControl = (VideoControl) player.getControl("VideoControl");
            Field videoField = (Field) videoControl.initDisplayMode(

and then we add this field to Screen/Manager.


So first check if you get the field correctly before adding(as in case of audio this may be null)--


if (videoField != null){




I have not tried it but give it a try it may help.

Rishikesh Singh