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

Java Development

Reply
New Contributor
Posts: 3
Registered: ‎11-19-2012
My Device: Blackberry 9380
My Carrier: Airtel

Video Recording Problem

Hi I cannot record videos in blackberry properly. My requirement is that I have to record a video for 10s. I am using the following piece of code to start and stop record.

 

 

start_record();
UiApplication.getUiApplication().invokeLater(new Runnable() {
    public void run()
    {
        Thread.sleep(10000);
        stop_record();
        commit();
    }


 

The stop record, stops the record controller, while commit commits, closes the player and exits the screen.

 

The program records the file properly first time, while I cannot play the file without opening and closing camera. If I open this file without opening and closing camera, I get a message saying "cannot play media while third party recording is active".

 

If I continuously record twice using the application, the file size of the new video becomes 0KB.

 

Any help on this is appreciated.

 

Thanks,

 

Lanka

New Contributor
Posts: 3
Registered: ‎11-19-2012
My Device: Blackberry 9380
My Carrier: Airtel

Re: Video Recording Problem

Can some one please let me know if automatic recording for 10 seconds and closing the video recording is possible in blackberry. This is a requirement on which I have to work on. I want to know if I am chasing a problem which is impossible to solve.
Retired
Retired
Posts: 150
Registered: ‎10-19-2010
My Device: Not Specified
My Carrier: Rogers

Re: Video Recording Problem

Hi!

 

Take a look at this KB article: Everything You Want To Know About Multimedia But Don't.

 

Especially the sections 'Player States Explained' and 'Handling Media Interruption'.  I suspect you are leaving your previous player open preventing the next one from starting.  Openning the camera solves it because it is 'stealing' the resources from your first player (on open) then releasing them (on close) and that's why your next recording attempt works.