GithubHelp home page GithubHelp logo

Comments (9)

brianwernick avatar brianwernick commented on May 26, 2024

You should continue using a static (singleton) implementation for the PlaylistManager. When switching a playlist you will need to

  1. Update the actual playlist storage in the PlaylistManager (setParameters(...))
  2. Update the playlist id (setPlaylistId(...))
  3. Set the index of the item to play (setCurrentItem(...))
  4. Start playback (play(...))

from exomedia.

vsay01 avatar vsay01 commented on May 26, 2024

As I mentioned I tried to use static implementation:
Here is the current issue I have Though I will recheck it again.
Scenario:

  • I click on a song called A from list 1 --> AudioPlayerAcitivty.java started and play song A
  • go back and choose a song called A" from list 2 --> AudioPlayerActivity.java started ( go to onResume - since already created before) and play song A"
  • go back to playlist or home screen
  • select the foreground notification

Expected: open AudioPlayerActivity and play song A" list 2

Actual: open AudioPlayerActivity and play song A list 1

I tried to track down the value static playlistManager in the App.java, it changed when A" from list 2 clicked but the problem is that when A' from list 1 clicked and play the service started already and when A" from list 2 clicked the player not started again since it will fire the onResume() callback of the AudioPlayerActivity.java.

Let me know if you need clarification...
Thank

from exomedia.

brianwernick avatar brianwernick commented on May 26, 2024

What is your implementation of protected PendingIntent getNotificationClickPendingIntent() in the PlaylistService?

from exomedia.

vsay01 avatar vsay01 commented on May 26, 2024

Here it is
@OverRide
protected PendingIntent getNotificationClickPendingIntent() {
Log.e("AuoSeice geNotiClkP= ", getMediaPlaylistManager().getPlayListId()+"");
Intent intent = new Intent(getApplicationContext(), AudioPlayerActivity.class);
intent.putExtra(AudioPlayerActivity.EXTRA_INDEX, getMediaPlaylistManager().getCurrentIndex());
intent.putExtra(AudioPlayerActivity.EXTRA_PLAYLISTID, (int)getMediaPlaylistManager().getPlayListId());
return PendingIntent.getActivity(getApplicationContext(), FOREGROUND_REQUEST_CODE, intent, PendingIntent.FLAG_UPDATE_CURRENT);
}

from exomedia.

brianwernick avatar brianwernick commented on May 26, 2024

OK, currently the pendingIntent is only updated when the service is set as a Foreground service. I'll update it shortly to correctly update when the notification is updated.

from exomedia.

vsay01 avatar vsay01 commented on May 26, 2024

Great thank,
I suppose after that update, the singleton implementation for multi playlist should be fine.

from exomedia.

brianwernick avatar brianwernick commented on May 26, 2024

Yep. I usually have a different setup so I haven't hit this issue before. I should be releasing 2.5.2 in a few minutes

from exomedia.

brianwernick avatar brianwernick commented on May 26, 2024

2.5.2 has been released

from exomedia.

vsay01 avatar vsay01 commented on May 26, 2024

Confirm fixed.. Thank

from exomedia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.