Comments (9)
You should continue using a static (singleton) implementation for the PlaylistManager. When switching a playlist you will need to
- Update the actual playlist storage in the PlaylistManager (
setParameters(...)
) - Update the playlist id (
setPlaylistId(...)
) - Set the index of the item to play (
setCurrentItem(...)
) - Start playback (
play(...)
)
from exomedia.
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.
What is your implementation of protected PendingIntent getNotificationClickPendingIntent()
in the PlaylistService?
from exomedia.
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.
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.
Great thank,
I suppose after that update, the singleton implementation for multi playlist should be fine.
from exomedia.
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.
2.5.2 has been released
from exomedia.
Confirm fixed.. Thank
from exomedia.
Related Issues (20)
- how to support avi video HOT 1
- `setVideoRotation` Not Rotating Video HOT 2
- ExoMedia does not support AVI video format HOT 1
- OverideDuration is not working HOT 1
- Player is accessed on the wrong thread HOT 1
- Source error
- AppBar show during controller show in full screen. HOT 2
- ReSize Mood add into Exoplayer HOT 6
- Update TV Video Player Controls
- When will 5.0.0 be released? HOT 3
- Improved VideoControls Error Handling
- Crash when add library ExoPlayer 2.17.0 HOT 5
- ExoMedia demo crashes with v5.0.0 on Android 8.1 and Android 9 virtual devices HOT 1
- jetifier enabled in demo app (migrate constraintlayout) HOT 3
- Many requests to server HOT 1
- Authentication: Bearer token HOT 2
- the video window will shake
- [Question] What about using your library for content URI scheme?
- can this project support to a minium version of android 17? HOT 1
- Can open videoplayback file?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exomedia.