BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-07-2010, 07: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 07: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





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