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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| 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. |
| Sponsored Links |
| |||
| 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.. |
| |||
| 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. |
| |||
| 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 |
| |||
| 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.. |
| |||
| 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 |
| |||
| 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! |
| |||
| 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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |
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 |