×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    233

    Problem with media API

    I have found a problem when I have two players at the same time, in two different threads of my application. One of them plays local mp3 files, and the other one plays streaming over rtsp. They work correctly by sepparate.
    I have two buttons Pause and Restart which work correctly, pausing and restarting a local mp3 file reproduction. But when I start streaming, and I pause the player, if I want to restart the player when the streaming ends, it doesn't works. I would like to comment that a closed event is triggered in playerupdate function...

    My question is if it is possible to have some Player running at the same time in the same application (in different threads).

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: Problem with media API

    It may be possible depending on the device. What device are you using? What happens when you have two Players playing mp3 files in different threads?

    Daniel

  3. #3
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    233

    Re: Problem with media API

    I have not tried two players at the same time in two threads, I will try it and comment to you. I am using a Nokia N91.

  4. #4
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    233

    Re: Problem with media API

    I can't play two mp3 files in two different threads at the same time. The second player is closed (in playerupdate method)... I don't know what could be the problem then... Perhaps it is not allowed to have two players running at the same time...

  5. #5
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: Problem with media API

    I don't recall from the top of my head whether N91 has "supports.mixing" available. Can you test that system property? If it's available, the following conditions must be true:

    - At least two tones can be played with Manager.playTone simultaneously.
    - Manager.playTone can be used at the same time when at least one Player is playing back audio.
    - At least two Player's can be used to play back audio simultaneously.

  6. #6
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    233

    Re: Problem with media API

    My application has two threads with one Player object each one, which play one of them local mp3 files, and the other streaming over rtsp. When I start playing streaming the mp3 must be paused (using Player.stop()), and when streaming is finished, the mp3 must be start from the point where it was (using Player.start()).

    The problem is that when the player is started again, a closed event is triggered....

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

    Re: Problem with media API

    From the MMAPI implementation document available in the Java ME Developer's guide

    "[Changes] From S60 2nd Edition FP 3 to S60 3rd Edition
    ...
    MMAPI audio mixing is supported. See section Audio mixing for details."

    "Simultaneous playback with minimum of two players is supported. More may be supported depending on the platform version and product. Players can be of any content types. Support for mixing can be queried from the property "supports.mixing".

    Processing power requirements for a player vary depending on the content type. Simultaneous playback of two players with the same content roughly doubles the needed processing power. Thus it may not be viable to play two "audio/mp3" contents concurrently whereas two "audio/wav" could be played."

    Hartti

  8. #8
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    233

    Re: Problem with media API

    I am trying to play a mp3 file, and a streaming. When streaming is being played, mp3 is paused (using stop method). Using setMediaDuration to simulate a pause is neither working (mediaexception).

    Do you mean that for instance in other devices (series 40) is not supported that mixing?

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

    Re: Problem with media API

    Mixing support has not been around for long. Many devices support only one player simultaneously.
    On Series 40 side, swap and play is supported since Series 40 3rd Edition FP1

    "The Series 40 implementation supports "Swap and Play” functionality. For certain audio content, this works by allowing a MIDlet to prefetch more than one player, and pause one player while resuming another. In this way, several active players can exist at once. (True mixing is not yet supported.)

    In the Series 40 implementation, calling start() on one player does not automatically stop a player that is already running."

    Hartti

  10. #10
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    233

    Re: Problem with media API

    And do you know why is triggered a closed event on player when I call to start() function on a stopped played? It seems that when I start the streaming player, the other player becomes closed... The two players are in different threads, and I have tested that calling stop() and start() method of the Player pauses and resumes the playing...

    I think it is a problem related to have two Players at the same time in the app, but I am not sure.

Similar Threads

  1. Problem with Camera API (S60 2.0)
    By tpikkara in forum Symbian
    Replies: 20
    Last Post: 2008-05-26, 06:39
  2. access points problem with HTTP client api
    By Svat_ in forum Symbian
    Replies: 1
    Last Post: 2006-12-26, 16:19
  3. N70 Media Key problem
    By michaelhansen_79 in forum Symbian
    Replies: 0
    Last Post: 2006-11-14, 08:31
  4. Problem with Media Key N70
    By michaelhansen_79 in forum Symbian
    Replies: 0
    Last Post: 2006-11-08, 15:33
  5. Mobile Media API
    By anupamah in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2003-07-10, 08:38

Posting Permissions

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