You Are Here:

Community: Developer Discussion Boards

#1 Old Question Null pointer error in read video files - 2009-07-28, 10:35

Join Date: Jul 2009
Posts: 2
souhomura
Offline
Registered User
Hello. I am a new guy in J2ME.
I want to do a sample about reading video files, and I always get a null pointer error.

The following code is to download a video from URL and play it.

InputStream is = HttpConn.urlToStream("http://myserver/video.mpg");
String contentType = "video/mpeg";
if (is == null)
{
//error
return;
}
Player player = Manager.createPlayer(is, contentType);
if (player == null)
{
//error
return;
}
//This class extends Canvas implements CommandListener&PlayerListener
player.addPlayerListener(this);

player.prefetch();
player.realize();
VideoControl videoControl = (VideoControl)(player.getControl("VideoControl"));

Then I get a null videoControl.Why? I am sure is and player are not null, and I can play the video if I open it in website.

Thanks in advance.
Last edited by souhomura : 2009-07-28 at 16:00.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Please its veru urgent on nokia 3250 siva_guduru Mobile Java General 8 2008-05-01 11:24
Video playback with sound but nothing on Screen abdullah829 Mobile Java Media (Graphics & Sounds) 5 2007-11-30 15:04
InConsistency in Uploading video files kumar_sai123 Symbian Networking & Messaging 0 2007-11-08 11:14
RecordEnumeration throwing null pointer exception kralvarado Mobile Java General 2 2006-04-13 05:07

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia