BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 04-07-2010, 06:43 AM   #1
zulfiqarchandio
Knows Where the Search Button Is
 
Join Date: Mar 2010
Model: 9700
PIN: N/A
Carrier: Engineer
Posts: 22
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


10-Count GE Fluorescent Ballast, GE432-MVPS-L Electronic T8, 120v to 277v picture

10-Count GE Fluorescent Ballast, GE432-MVPS-L Electronic T8, 120v to 277v

$108.99



4 Count Case GE ProLine 2 Bulb 120V T12 Electronic Fluorescent Light Ballasts picture

4 Count Case GE ProLine 2 Bulb 120V T12 Electronic Fluorescent Light Ballasts

$49.99



Inter-Global IG13-20EL electronic ballast 120v New Common Aquarium Light Ballast picture

Inter-Global IG13-20EL electronic ballast 120v New Common Aquarium Light Ballast

$19.95



QHE 4X32T8/UNV ISH-SC Sylvania 51347 4-Lamp T8 Instant Start Fluorescent Ballast picture

QHE 4X32T8/UNV ISH-SC Sylvania 51347 4-Lamp T8 Instant Start Fluorescent Ballast

$9.00



Advance RS-2S110-2-TP Rapid Start Ballast picture

Advance RS-2S110-2-TP Rapid Start Ballast

$49.99



Metal Halide Ballast Kit 400W Multi 5 Tap 120V 208V 240V 277V 480V M59 picture

Metal Halide Ballast Kit 400W Multi 5 Tap 120V 208V 240V 277V 480V M59

$49.95







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