Join Our 3 MILLION+ Members Today! Register Here | Login
Go Back   BlackBerry Forums at CrackBerry.com > BlackBerry Professionals > App Developers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
    Thread Author   #1  
Old 07-12-2011, 01:45 AM
CrackBerry Newbie
 
Join Date: Jul 2011
Posts: 4
Likes Received: 0
Thanked 0 Times in 0 Posts
Default problem to play video

class VideoView extends MainScreen
{
private Player _player;
private Field _videoField;
private VideoControl _vc;

// Constructor
public VideoView(final BrdcstMessage msg)
{
super(net.rim.device.api.ui.Manager.NO_VERTICAL_SC ROLL);

System.out.println("*****initVideo over*");


initVideo(msg._MsgUrl); //msg._MsgUrl = rtsp://website addess/some.3gp;

if(_videoField != null)
{
System.out.println("*****_videoField*"+_videoField );
displayVideo();
System.out.println("*****displayVideo over*");
}
}


private void setVideoSize(int width, int height)
{
try
{
if (_vc != null)
{
System.out.println("set video size");
_vc.setDisplaySize(width, height);
System.out.println("set video size---------");
}
}
catch(MediaException pe)
{
System.out.println(pe.toString());
}
}

/**
* Creates and initializes a video player
* @param url The URL of the video file to play
*/
private void initVideo(String url)
{
try
{
_player = javax.microedition.media.Manager.createPlayer(url) ;
_player.realize();
System.out.println("*****_player *"+_player);
_vc = (VideoControl) _player.getControl("VideoControl");
System.out.println("*****_vc *"+_vc);
if (_vc != null)
{
_videoField = (Field) _vc.initDisplayMode (VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
System.out.println("*****_videoField *"+_videoField);
_vc.setVisible(true);
}
}
catch(MediaException pe)
{
System.out.println("--------initVideo-----MediaException="+pe.getMessage());
}
catch (IOException ioe)
{
System.out.println("--------initVideo-----MediaException="+ioe.getMessage());
}
}

private void displayVideo()
{
// setTitle("Send Media Demo");
add(_videoField);
System.out.println("*****displayVideo-----------_videoField added*");

try
{
// Start media player
_player.start();
System.out.println("*****displayVideo-------------_player started*");
}
catch(MediaException pe)
{
System.out.println("--------displayVideo-----MediaException="+pe.getMessage());
}
}

protected void sublayout(int width, int height)
{
System.out.println("--------sublayout");
setVideoSize(Display.getWidth(), Display.getHeight());

super.sublayout(width, height);
}


public boolean onClose()
{
System.out.println("--------onClose");
_player.close();
System.out.println("onClose");
return super.onClose();
}
}

this is my code. i create media player to play the video file from server... when i try to run that i got some error.. the following error is


Thread [net_rim_services_impl(5)id=441311232] (Suspended (exception UnsupportedOperationException))
MediaPlayer.mediaLoaded(int) line: 622
MediaNatives$MediaNativesEventDispatcher.dispatch( Message, Object) line: 386
EventDispatchManager.dispatch(int, Message, Object[]) line: 59
Proxy(Application).processNextMessage(Message) line: 1704
Proxy(Application).enterEventDispatcher() line: 991
ServiceStartup.tier0() line: 90
ServiceStartup.main(String[]) line:

can u please tell me what is the problem in that code.. say some solution for that pls..
Reply With Quote Tip this Post
  #2  
Old 07-12-2011, 02:03 AM
CrackBerry Genius
Device(s): 9650 Bold (non-camera)
Carrier: Sprint/Nextel
 
Location: Rhode Island
Join Date: Jul 2009
Posts: 2,698
Likes Received: 187
Thanked 129 Times in 107 Posts
Default

What is this, code for some virus?

Posted from my CrackBerry at wapforums.crackberry.com
Reply With Quote Tip this Post
    Thread Author   #3  
Old 07-12-2011, 02:22 AM
CrackBerry Newbie
 
Join Date: Jul 2011
Posts: 4
Likes Received: 0
Thanked 0 Times in 0 Posts
Default

this is a code for play video file in blackberry.. i got some error.. i mension above.. can u pls help me
Reply With Quote Tip this Post
    Thread Author   #4  
Old 07-12-2011, 05:12 AM
CrackBerry Newbie
 
Join Date: Jul 2011
Posts: 4
Likes Received: 0
Thanked 0 Times in 0 Posts
Default

anybody reply for this post
Reply With Quote Tip this Post
  #5  
Old 07-12-2011, 09:39 AM
CrackBerry Genius
Device(s): 9930 (Bold) Playbook 32gig
Carrier: Verizon
Pin: 3302D65A
 
Location: Tacoma WA
Join Date: Apr 2010
Posts: 3,794
Likes Received: 203
Thanked 187 Times in 166 Posts
Default

Why do you NOT have video capabilities? All blackberrys support video playback and record. If the format is not compatible there are many free converters available.

Posted from my CrackBerry at wapforums.crackberry.com
Reply With Quote Tip this Post
    Thread Author   #6  
Old 07-13-2011, 12:08 AM
CrackBerry Newbie
 
Join Date: Jul 2011
Posts: 4
Likes Received: 0
Thanked 0 Times in 0 Posts
Default

i create a application to play the 3gp video files through RTSP server.. im using curve 8900.. the bb os is 4.6.1. when try to play the file.. my simulator is play video only one second then its freeze.. then i got above error as i mension earlier.. can u describe that what is the error.. why its coming..
Reply With Quote Tip this Post
Reply
BlackBerry Forums at CrackBerry.com > > BlackBerry Professionals > App Developers   problem to play video

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes