×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    19

    Cannot create player..

    Hi folks,

    Code:
    public void run ()
        {
            System.out.println ("Media URL : " + videoURL) ;
           try
            {      
                myCanvas.setFullScreenMode(true);
                player = Manager.createPlayer (videoURL);
                player.addPlayerListener(this) ;
                player.realize ();
                // player.setLoopCount(-1) ; // play infinitely
                vc = (VideoControl) player.getControl ("VideoControl");
                if(vc != null)
                {
                    vc.initDisplayMode (vc.USE_DIRECT_VIDEO, myCanvas);
                    vc.setDisplayLocation ( 0 , 25 );
                    vc.setDisplaySize (Device.WIDTH, Device.BUTTON_Y -25);
                    vc.setVisible (true);
                }
                  
                player.prefetch ();
                
                player.start () ;
                          
            }
            catch(Exception e)
            {
                e.printStackTrace();
                      
            }
        }
        public void stopPlayer ()
        {
           try
            {
                if (player.getState () != player.CLOSED)
                {
                    vc.setVisible(false);
                    vc = null;
                    player.stop () ;
                    player.deallocate();
                    player.close () ;                
                }            
            }
            catch(Exception e)
            {
                e.printStackTrace ();
            }
        }
    
        public void playerUpdate(Player player, String event, Object eventData) {
           listner.playerUpdated(player, event, eventData);
        }
        
        public Player getPlayer(){
            return this.player ;
        }
        
    }

    What is wrong with this code ??? This gives me "MediaException: Cannot create player."
    Any guess ?? Even running on Emulator same exception is encountered.

    Regards,
    Bharat Patel.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Cannot create player..

    Hi,

    On which phone/emulator are you getting that Exception, and with which URL(s)?

    Pit

  3. #3
    Registered User
    Join Date
    Oct 2007
    Posts
    19

    Re: Cannot create player..

    Hi jappit,

    Well I tried it on Nokia Emulator S60 E3. Also on Nokia E90.
    The url points to a video file(.mpg) on server.

    http://myServer/../myfile.mpg

    Is there any constraint on type of media file that could be played? I mean, can I play "XYZ.mpg" file or I need to play "XYZ.3gp" only??

    Regards,
    Bharat Patel.

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

    Re: Cannot create player..

    This spreadsheet gives some guidance
    http://www.forum.nokia.com/info/sw.n..._0_en.xls.html

    3gp is quite widely supported

    Hartti

  5. #5
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    220

    Re: Cannot create player..

    Hi there,

    to be confirm whether the media file is supported in your handset or not, just download the mpg file in your handset and try to play it using phone's native player. if it plays then there is no issue of format support.

    I may sound foolish but since i have experienced it few times I am mentioning- be sure that the phone is not in silent mode

    Regards
    Amit

  6. #6
    Registered User
    Join Date
    Dec 2004
    Posts
    369

    Re: Cannot create player..

    what is the encoding video type of the mgp file?
    is it MPEG4?
    H264?

Similar Threads

  1. application error with 3gp file in J2ME
    By ruchig_iic in forum Mobile Java Media (Graphics & Sounds)
    Replies: 10
    Last Post: 2012-01-16, 21:40
  2. real player or nokia player in 6600 support 3gpp streaming?
    By diabol in forum Streaming and Video
    Replies: 4
    Last Post: 2008-05-25, 14:39
  3. cannot able to play a video file.
    By shalini.mishra in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2006-11-13, 16:54
  4. Chaining Player instances smoothly
    By jrosebor in forum Mobile Java General
    Replies: 3
    Last Post: 2005-10-18, 06:36
  5. Video Player Midlet problem - please help
    By L_Tambiah in forum Mobile Java General
    Replies: 0
    Last Post: 2004-06-26, 15:00

Posting Permissions

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