×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Feb 2007
    Posts
    24

    exception :Invalid Locator, need help

    Hello to all,
    i need help, my exception is
    Exception: javax.microedition.media.MediaException: Invalid locator: rtsp://qt.nmi.uga.edu:554/cmartin/some_postman.3gp

    how can i fix it?
    code is here:

    Code:
    public class StreamingVideo extends MIDlet implements CommandListener, PlayerListener, Runnable{
        
        
        private Display myDisplay; 
        private Form myForm;
        private Alert a;
        private StringItem strit;
        private Thread streamingThread;
        private Player myPlayer;
        private VideoControl vc;
        private boolean running=false;
        
        public StreamingVideo() {
            myDisplay = Display.getDisplay(this);
            myForm=new Form ("Streaming Test");
            myForm.addCommand(new Command("Exit", Command.EXIT,0));
            myForm.addCommand(new Command("Start", Command.OK,0));
            strit = get_stringItem1();
            strit.setText("ahanda");
            myForm.append(strit);
            myForm.setCommandListener(this); 
        }
       
    
        protected void startApp() throws MIDletStateChangeException {
            myDisplay.setCurrent(myForm);  
            streamingThread = new Thread(this);
        }
    
        protected void pauseApp() {}
    
        protected void destroyApp(boolean unconditional) {
            try {
                myPlayer.stop();
                myPlayer.close();
            }
            catch( Exception e ) {
                log("Exception: " + e.toString());        
            }
        }
        
       
        private void startStreaming(){
            try{
                                                
                 myPlayer = Manager.createPlayer("rtsp://qt.nmi.uga.edu:554/cmartin/some_postman.3gp");
                 
                 myPlayer.addPlayerListener(this);
                 
                 myPlayer.realize();
                 
                  
                  vc = (VideoControl)myPlayer.getControl("VideoControl");
                  if (vc != null) {
                    myForm.append((Item)vc.initDisplayMode(vc.USE_GUI_PRIMITIVE, null));
                    
                    vc.setDisplaySize(120,160);  
                  }          
                  myPlayer.start(); 
    
             }catch(Exception e){
                    log("Exception: " + e.toString());
             }
    
        } 
       
        public void commandAction(Command c, Displayable s){
            if(c.getCommandType()==Command.EXIT){
                running=false;
                notifyDestroyed();
            }else{
                streamingThread.start();
            }
        }
        
        
         
         public void playerUpdate(Player player, String event, Object eventData){
            log(" ** playerUpdate: " + event + " **");
           
         }
    
         public void log(String msg){
            strit.setText(msg);
            System.out.println(msg);
         }
         
         public void run() {
             running=true;
             startStreaming();
             while(running){
                 Thread.yield();
             }
         }     
         public void log2(String msg){
        	a = new Alert("Exception", msg, null, AlertType.CONFIRMATION);
        	myDisplay.setCurrent(a, myForm);
         }
         public StringItem get_stringItem1() {
            if (strit == null) {
                
                strit = new StringItem("strit", "<Enter Text>");
               
            }
            return strit;
        }
    }
    red part is reason of exception, thanks for helps.

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: exception :Invalid Locator, need help

    Which phone you are testing this on? Note that rtsp is not supported on all of the devices.

    Hartti

Similar Threads

  1. VS.Net 2003 Carbide 2.01 and epoc32.exe
    By ValentinK in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2007-01-12, 12:31
  2. Invalid Heap Pointer Exception
    By zavagoo in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2004-06-03, 16:35
  3. Catching an exception
    By btnokdev in forum Mobile Java General
    Replies: 2
    Last Post: 2003-10-11, 14:45
  4. J2ME cannot report exception line number???
    By dying in forum Mobile Java General
    Replies: 2
    Last Post: 2003-09-02, 09:08
  5. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×