×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    13

    Manager.createPlayer(url) failure

    Hi,

    following is a piece of code I am trying to use:
    FileConnection dummy = (FileConnection) Connector.open(url);
    if (dummy.exists()) {
    player = Manager.createPlayer(url);
    player.addPlayerListener(this);
    player.realize();
    player.prefetch();
    }
    I am using the S40_SDK_3rd_Edition emulator.

    The url value is: "file:///C:/predefgallery/predefmusic/popeeye.wav"
    The file is created by the program (after downloading it) and exists on the file system. Then when arriving to the createPlayer method it fails but I don't know why.

    I checked the file and it is valid (I played it through the built-in player of the emulator).

    Can someone help with find the reason for the failure?

  2. #2
    Registered User
    Join Date
    Nov 2007
    Posts
    13

    Re: Manager.createPlayer(url) failure

    Some more details:
    After reading the exception data I can see that the exc message is: "Invalid locator: ... {the url}"
    The Manager.getSupportedContentTypes("http") return several supported media types including "audio/wav", but not "audio/x-wav".
    The Manager.getSupportedContentTypes("file") cause me an exception.
    When I ask for Manager.getSupportedProtocols("audio/wav"), i get only "http".

  3. #3
    Regular Contributor
    Join Date
    Sep 2007
    Location
    Thirunelveli
    Posts
    115

    Re: Manager.createPlayer(url) failure

    Hi beyossi,
    I beleive the file locator won't be supported. Inorder to play this please use this method.
    Manager.createPlayer(InputStream is, String mediaType)

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    13

    Re: Manager.createPlayer(url) failure

    Quote Originally Posted by senthil_k View Post
    Hi beyossi,
    I beleive the file locator won't be supported. Inorder to play this please use this method.
    Manager.createPlayer(InputStream is, String mediaType)
    I am failing to get the InputStream through getResourceAsStream API.
    It works when I am taking the file from the JAR res files.
    However I need to play the files from an external directory and there I face problems to get the files using the getResourceAsStream API.

    As I mentioned, I am using the S40_SDK_3rd_Edition emulator.

    The inputs I tried:
    is = this.getClass().getResourceAsStream("/C:/predefgallery/predefmusic/popeeye.wav");
    is = this.getClass().getResourceAsStream("C:/predefgallery/predefmusic/popeeye.wav");
    is = this.getClass().getResourceAsStream("/predefgallery/predefmusic/popeeye.wav");
    is = this.getClass().getResourceAsStream("popeeye.wav");
    is = this.getClass().getResourceAsStream("/popeeye.wav");

    All of them returned null!

    BTW - can you help with specifying how to set the class path for the Nokia series 40 device? - that might help with the above problem.

  5. #5
    Registered User
    Join Date
    Nov 2007
    Posts
    24

    Re: Manager.createPlayer(url) failure

    baseURL = getAppProperty("baseURL");
    String resfile_name = baseURL+"?IMEI_NO="+IMEI_NO;
    c = (StreamConnection)Connector.open(resfile_name);
    InputStream in = c.openInputStream();
    InputStreamReader isr = new InputStreamReader(in);
    -Praveen Saini
    Catalytic Software
    praveen.saini@catalytic.com

Similar Threads

  1. Failure of MEM 02 (Failure of low memory during execution.
    By ajitc in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 1
    Last Post: 2007-05-31, 21:34
  2. AddViewL() causing % failure on LowMem
    By vishalm in forum Symbian
    Replies: 4
    Last Post: 2007-01-11, 12:59
  3. problem of test failure (using LowMem tool)
    By yogesh.bhople in forum Symbian
    Replies: 0
    Last Post: 2007-01-03, 09:59
  4. cpp.EXE failure from command line (CW works)
    By mikfi in forum Symbian Tools & SDKs
    Replies: 6
    Last Post: 2006-07-18, 16:11
  5. SMS Send Failure
    By otmike39 in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2003-07-29, 09:28

Posting Permissions

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