View Single Post
Old 06-30-2009, 02:06 AM   #5
qt_chenchen
Knows Where the Search Button Is
 
Join Date: Sep 2008
Model: 7100T
PIN: N/A
Carrier: Carrier
Posts: 18
Default

Hi again,

I got something unusual. I checked all the directories listed a while ago using this code:
Code:
FileConnection fsC = (FileConnection)Connector.open(videoURL);
if(fsC.exists()){
   WriteLog("Video Exists");
} else {
   WriteLog("Video Dont Exists");
}
using this code, I verified that all of the directories I listed on my previous post exists. So let's forget about the directory issues for now, since it was confirmed that the directories I had been using is valid.

Now, I tracked the behavior of my application when playing video and here is the result. The Code below used to initialize the media I am going to play:
Code:
private void initializeMedia()
    {         
        try
        {   
            /* For the purpose of this sample we are supplying a URL to a media file
            that is included in the project itself. 
            See the javax.microedition.media.Manager javadoc for more information on 
            handling data residing on a server.
            */
            _player = javax.microedition.media.Manager.createPlayer(videoURL);
            WriteLog("createPlayer");
            _player.setLoopCount(7);
            _player.realize();            
            WriteLog("realize");
            VideoControl vc = (VideoControl) _player.getControl("VideoControl");
            WriteLog("getControl");
            _videoField = (Field) vc.initDisplayMode (VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
            vc.setVisible(true);
            WriteLog("setVisible");                    
        } catch(MediaException pe) {
            System.out.println(pe.toString());
            WriteLog("MediaException");
        } catch (IOException ioe) {
            System.out.println(ioe.toString());
            WriteLog("ioe");
        } catch (IllegalArgumentException iae) {
            System.out.println(iae.toString());            
            WriteLog("iae");
        }
So, as fas as my code tracking is concern, the codes colored with red are the ones that my application doesn't execute. Because on my log, the last thing that was logged was getControl. So it means that, either the variable vc is NULL or it has an exception. But as you can see on that code, I also log it when there's an exception, and on my log it doesn't have any exceptions. So probably, the variable vc is really has a NULL value.

Now, my question is that how come that my VideoControl (variable vc) is getting NULL values when my directories/URL pointing to the video I want to play is VALID?

I hope you can help me now with this one. Thanks!
Offline   Reply With Quote