IT Community - Software Programming, Web Development and Technical Support

problem in createPlayer()

This is a discussion on problem in createPlayer() within the Mobile Software Development forums, part of the Software Development category; Am doing video application with Video Control in my Midlet. my purpose is to simply allow the user to take ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > Mobile Software Development

Register FAQ Members List Calendar Mark Forums Read
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 08-08-2007, 11:33 PM
bluesky bluesky is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 201
bluesky is on a distinguished road
Question problem in createPlayer()

Am doing video application with Video Control in my Midlet. my purpose is to simply allow the user to take snapshots and do some thing relating to it....now my problem is

The video works fine in the emulator, but when I downloaded the application to my Motorolo V220 phone, it says "createPlayer() failed."

What is going on here?
some one Please Help me..

Here's a snippet of the code:

Player capturePlayer = null;
...
capturePlayer = Manager.createPlayer("capture://video");
capturePlayer.realize();
canvas = new CaptureVideoCanvas(this);
canvas.setCommandListener(this);
...

class CaptureVideoCanvas extends Canvas {

// the base midlet
CaptureVideoAndImageMIDlet midlet = null;

// the video control
private static VideoControl videoControl = null;
public CaptureVideoCanvas(CaptureVideoAndImageMIDlet midlet)
throws Exception {
this.midlet = midlet;

// initialize the video control
videoControl = (VideoControl)
midlet.capturePlayer.getControl
("javax.microedition.media.control.VideoControl ");

// if not present, throw error
if(videoControl == null)
throw new Exception("No Video Control for capturing!");

// init display mode to use direct video and this form
videoControl.initDisplayMode(VideoControl.USE_DIRE CT_VIDEO, this);

try { // try and set the size
videoControl.setDisplayFullScreen(true);
// videoControl.setDisplaySize(getWidth() - 30, getHeight() - 30);
// videoControl.setDisplayLocation(15, 5);
}

catch(MediaException me) {
// but some devices may not support full screen mode
videoControl.setDisplayLocation(5, 5);
try {
videoControl.setDisplaySize(getWidth() - 10, getHeight() - 10);
} catch(Exception e) {}
repaint();
}

// and make the video control visible
videoControl.setVisible(true);
}

Last edited by bluesky : 08-08-2007 at 11:49 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-08-2007, 11:51 PM
H2o H2o is offline
D-Web Analyst
 
Join Date: Jul 2007
Posts: 246
H2o is on a distinguished road
Default Re: problem in createPlayer()

Have your tried using Manager.getSupportedProtocols() and Manager.getSupportedContentTypes() to see if and how the device supports video capture?

Next, do you know the exception class? This can help determine the root of the problem.
__________________
H2O

Without us, no one can survive..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-09-2007, 12:23 AM
bluesky bluesky is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 201
bluesky is on a distinguished road
Wink Re: problem in createPlayer()

Yes, I am using the exception class(I am unable to compile the code if I don't ) And through that, I am able to see the alert: "createPlayer() failed.".. but there is nothing more than that.

Also, the MIDlet works fine in the emulator. It is only when I upload it to the phone, that I get this error. I am stumped and don't know how to proceed with this.. please help or guide me in an alternate direction so that I can get the solution.

Basically I want a camera that can take a snapshot and then send it to my web server where the image will be stored.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-09-2007, 01:39 AM
mobilegeek mobilegeek is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 205
mobilegeek is on a distinguished road
Default Re: problem in createPlayer()

I recommend you attempt to capture and display the full stack trace. There's probably a secondary message that gives better details.

An emulator is not the same thing as a real device, so things won't always work quite the same. For that matter, ROMs get updated even between different versions of the real device, so it's always good if you can test on as many systems as possible
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-09-2007, 03:24 AM
H2o H2o is offline
D-Web Analyst
 
Join Date: Jul 2007
Posts: 246
H2o is on a distinguished road
Default Re: problem in createPlayer()

I am sorry. I should have been more specific.

I wanted to know the actually exception class name. From the exception text, I am almost certain that it is a MediaException. But similar text could result from a SecurityException. For example, you may not be able to create the player because the midlet lacks the permission to use the camera. And there is also the possibility of unchecked exceptions. It seems simple, but it can be an important hint in solving on-device issues.

On device debugging is an option. If your device supports on device debugging you can get the full stack trace. Alternatively, Nokia offers a free on-device testing service which you can use to test your code on multiple devices. The service is called RDA and is available here:

Remote Device Access

You can use the aforementioned methods on the Manager class to determine if the particular device supports video capture. In addition, you may need to add parameters to the capture URI.

You should check the supported content types for the capture protocol.

I created two similar applications a couple of years ago when I first started with J2ME. The worked fine on the S66 I was using at the time. The is available from the links below.

Photo capture and upload

fotomica - fotos from your mobile
Astrient Labs - J2ME

Video capture and upload

Astrient Labs - J2ME
--------------------

Rashid Mayes
Astrient Labs - J2ME
WorldDeveloper.org
__________________
H2O

Without us, no one can survive..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 08-09-2007, 03:38 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 325
amansundar is on a distinguished road
Default Re: problem in createPlayer()

I experienced the same problem with motorola devices. The specs say it supports video capture when it really doesn't. If you look through the developer forums within Motorola you can confirm this.
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 08-09-2007, 05:47 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Smile Re: problem in createPlayer()

I rememberd the moto A220 (and some other moto machine)have some question in video capture,so you can change other brand machine to try your soft.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 08-09-2007, 06:20 AM
bluesky bluesky is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 201
bluesky is on a distinguished road
Default Re: problem in createPlayer()

Hi,
I did some practicals on MMAPI now and found out that Sony Ericsson doesn't support capturing audio, video and playing mpeg4 video as well. I am not sure about the Motorola cause I didn't get the chance of trying the programs in a motorola. But my guess would be the reason is the real device implementation
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/mobile-software-development/3242-problem-createplayer.html
Posted By For Type Date
mediaException | www.securemoreresult.info This thread Refback 10-10-2007 09:31 PM
DiscussWeb IT Community - Fusing This thread Refback 08-09-2007 05:59 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
a new problem? saravanan Computer Hardware 0 03-24-2008 07:09 AM
Laptop problem ammulu Computer Hardware 1 02-11-2008 03:31 AM
Problem in IE krishnakumar HTML, CSS and Javascript Coding Techniques 13 11-28-2007 09:51 PM
Problem on .net 3.0 WPF! theone C# Programming 0 07-19-2007 10:56 PM
DNS problem vadivelanvaidyanathan Server Management 0 07-15-2007 06:49 PM


All times are GMT -7. The time now is 10:28 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0