BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-07-2010, 06:43 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2010
Model: 9700
PIN: N/A
Carrier: Engineer
Posts: 22
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Video Player

Please Login to Remove!

Hi, i have written the code for playing video file in bb, but when i run the program excepetion occurs like.

( javax.microedition.media.MediaException ) although i have caught the exception.

My code is:

package VideoProject;

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import javax.microedition.media.Manager;
import javax.microedition.media.Player;
import java.io.IOException;
import javax.microedition.media.control.VideoControl;
import net.rim.device.api.ui.DrawStyle;
import javax.microedition.media.control.*;

class TestVideo extends MainScreen
{



TestVideo()
{


try{
Player player;
VideoControl videoControl;
player = Manager.createPlayer("/res/BlackBerry/videos/vid.3gp");
player.realize();
videoControl = (VideoControl)player.getControl("VideoControl");
videoControl.initDisplayMode(VideoControl.USE_DIRE CT_VIDEO,this);
GUIControl gc;
if ((gc = (GUIControl)player.getControl("GUIControl"))!=null )
{
add((Field)gc.initDisplayMode(GUIControl.USE_GUI_P RIMITIVE,null));
}//if

videoControl.setDisplayLocation(15,200);
videoControl.setDisplaySize(200, 200);
videoControl.setVisible(true);
player.start();

}catch (Exception e){
System.out.println("Exception in video playing..."+e);
}
}//constructor


}//class



package VideoProject;

import net.rim.device.api.ui.UiApplication;


class VideoApp extends UiApplication
{
public static void main(String args[])
{

VideoApp app = new VideoApp();
app.enterEventDispatcher();
}

VideoApp()
{

TestVideo mainScreen=new TestVideo();
pushScreen(mainScreen);
}
}



can u explain why this occurs. if u have any other example then plz write the code in reply.

Thanks in advance.

Regards:

Zulfiqar

Last edited by zulfiqarchandio : 04-07-2010 at 06:47 AM.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

WRIST COIL KEY HOLDER BLUE 5/PK per 6 Pack
$36.88
WRIST COIL KEY HOLDER BLUE 5/PK per 6 Pack pictureWESTINGHOUSE BF66F LOT OF 8 765A953G01 USED 300V 10A 120V COIL SEE PICS #A77
$160.0
WESTINGHOUSE BF66F LOT OF 8 765A953G01 USED 300V 10A 120V COIL SEE PICS #A77 picturePARKER 7131Z002N0C111C2 Coil and Plunger Assembly 24 V DC 10W
$65.0
PARKER  7131Z002N0C111C2 Coil and Plunger Assembly 24 V DC 10W pictureHeavy Duty Coil Framing Nailer
$329.6
Heavy Duty Coil Framing Nailer pictureNEW SPORLAN ME10S250 5/8" LIQUID LINE SOLENOID VALVE. (LESS COIL)
$25.5
NEW SPORLAN ME10S250 5/8






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.