Chirag Ravishankar

Greenhorn
+ Follow
since Jun 27, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chirag Ravishankar

Thank you for your reply..

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.
16 years ago
I have a Video Control in my Midlet. I purpose is to simply allow the user to take snapshots (similar to the camera) and do other things..
The video works fine in the emulator, but when I downloaded the app to my Motorolo V220 phone, it says "createPlayer() failed."
What is going on here? Huh Huh Huh
Please Help..

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_DIRECT_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);
}
16 years ago