×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Mar 2008
    Location
    Cairo-Egypt
    Posts
    23

    Problem creating player on N81

    Hey everybody,

    I'm facing a weird problem here, my application reads a list of URLs from a server using a socket connection , then use one of these URLs to create the player.

    Reading from the socket and creating the player are functioning well separately, but when I'm using the received URL to create the player it get stuck at this line

    myPlayer=Manager.createPlayer(url);
    url=itemTable.get(itemName);
    where itemTable is a Hashtable where I keep the URLs.

    This problem appears only on the mobile device N81, while the application works perfectly on the WTK 2.5 and Nokia's S60 3rd edition SDK.

    Any ideas?!!

    Thanks in advance
    Lamiaa
    http://movi-az2.blogspot.com/

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: Problem creating player on N81

    What is the protocol you use?
    What is the file format?
    Is the URL abvailable in general to your phone (can you for example stream that in Real Player)?
    Have you tried a simple test application which justs creates a player with that URL (so no opening of sockets etc before creating the player)?

    Hartti

  3. #3
    Registered User
    Join Date
    Mar 2008
    Location
    Cairo-Egypt
    Posts
    23

    Re: Problem creating player on N81

    I'm using rtsp to stream (.rm) file, and yes the url is available and I've created the player successfully without the socket part.
    The problem appears only after reading from the socket.

    Thanks
    Lamiaa
    http://movi-az2.blogspot.com/

  4. #4
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: Problem creating player on N81

    And you are closing the socket connection before trying to start the streaming?

    Hartti

  5. #5
    Registered User
    Join Date
    Mar 2008
    Location
    Cairo-Egypt
    Posts
    23

    Re: Problem creating player on N81

    Yes, I do close the socket connection before streaming.

    This is the code I use to read from the socket
    public static String strReceiver()throws Exception{

    DataInputStream reader=strInput();

    currentThread().sleep(400);
    int count=reader.available();
    status="I have "+count+"bytes available";
    StringBuffer data=new StringBuffer();
    for(int i=0;i<count;i++){
    data.append((char)reader.readByte());

    }
    reader.close();

    return data.toString();
    }

    And this is how I call it in the Midlet

    public void callServer(){
    Thread myThread=new Thread(){
    public void run(){
    try{
    //monitoring.setText(MoviStream.status);
    MoviStream.strconnect();
    monitoring.setText(MoviStream.status);
    String data;
    currentThread().sleep(800);
    data=MoviStream.strReceiver();
    monitoring.setText(MoviStream.status);
    System.out.println(data);

    itemTable=Lists.buildTable(data);
    if(!itemTable.isEmpty())
    commandAction(Connect,Start);
    MoviStream.strConnection.close();/* the socket is closed here*/


    }
    catch(Exception e){

    e.printStackTrace();
    myAlert = new Alert("Exception",e.toString(), null, AlertType.CONFIRMATION);
    switchDisplayable(myAlert,getStart());
    }
    }
    }; myThread.start();

    }
    And here comes the problem:

    url=itemTable.get(choiceGroup1.getString(choiceGroup1.getSelectedIndex())).toString();
    myPlayer=Manager.createPlayer(url);
    The code works fine on S60 3rd edtion SDK but not on the mobile.

    Lamiaa
    http://movi-az2.blogspot.com/

  6. #6
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: Problem creating player on N81

    Have you tried closing the socket before you call the CommandAction (=right after calling the strReceiver()?

    Hartti

  7. #7
    Registered User
    Join Date
    Mar 2008
    Location
    Cairo-Egypt
    Posts
    23

    Re: Problem creating player on N81

    closing the socket before you call the CommandAction
    That was it
    Thanks Hartti

    Lamiaa
    http://movi-az2.blogspot.com/

Similar Threads

  1. Volume change problem in MP3 player on starting of application
    By shikhakhandelwal in forum General Development Questions
    Replies: 4
    Last Post: 2008-03-20, 02:34
  2. Nokia N95 8GB Music Player + earpiece problem! Help!
    By d0ud0u in forum General Development Questions
    Replies: 2
    Last Post: 2008-02-27, 05:08
  3. Problem in creating multi-page dialog
    By yogesh.sharma in forum Symbian
    Replies: 1
    Last Post: 2007-09-13, 08:40
  4. problem creating .rsg file
    By xersmith in forum Symbian Tools & SDKs
    Replies: 9
    Last Post: 2006-12-27, 13:48
  5. Problem with video file while creating an mms message.
    By pehyun in forum General Messaging
    Replies: 0
    Last Post: 2004-03-14, 16:13

Posting Permissions

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