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

SMPTE Output Studio 16 Extras The Complete SMPTE Generator For Your Amiga
$14.99
SMPTE Output Studio 16 Extras The Complete SMPTE Generator For Your Amiga picture23 WAY "D" SHELL HOOD DB23 D23 DB23F DB23M FOR COMMODORE AMIGA CONNECTORS - RARE
$2.56
23 WAY Toshiba TMP68HC000P-16 16mhz 68000 CPU Chip, Amiga Atari Apple Mac
$22.0
Toshiba TMP68HC000P-16 16mhz 68000 CPU Chip, Amiga Atari Apple Mac pictureAMIGA AMIGA A107-335D RQAUS1
$36.1
AMIGA AMIGA A107-335D RQAUS1 pictureCommodore AMIGA CSG 8520 Chip IC 500/A500+/A2000 CDTV - NEW
$12.99
Commodore AMIGA CSG 8520 Chip IC  500/A500+/A2000 CDTV - NEW picture






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