Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different Playlist #155

Closed
sujitkjha opened this issue Mar 29, 2016 · 5 comments
Closed

Different Playlist #155

sujitkjha opened this issue Mar 29, 2016 · 5 comments

Comments

@sujitkjha
Copy link

Sorry for bother you but I need your help, I want to populated 3 different playlist, Would you please guide me??

I am parsing different json to get data like top 20, new release etc

I want playlist of top20 and new release, How can I populated different types of playlist and use it in demo app ?????

I followed the #70 but can't understand how to update and where to update, please help me

@sujitkjha
Copy link
Author

I have tried something like passing intent extra whenever I call AudioPlayerActivity.class but it doesnt solved my problem
private boolean setupPlaylistManager() {
playlistManager = MainApplication.getPlaylistManager();

    //There is nothing to do if the currently playing values are the same
    if (playlistManager.getPlayListId() == PLAYLIST_ID) {
        return false;
    }
    List<MediaItem> mediaItems = new LinkedList<>();
    switch (playListNumber){

        case 0:
            for (AudioItems.AudioItem item : AudioItems.getItems()) {
                MediaItem mediaItem = new MediaItem(item);
                mediaItems.add(mediaItem);
                Log.e("Here", "getItems");
            }
                break;
        case 1:
            for (AudioItems.AudioItem item : AudioItems.getNewRelease()) {
                MediaItem mediaItem = new MediaItem(item);
                mediaItems.add(mediaItem);
                Log.e("Here","getNewRelease");
            }
                break;

    }

    playlistManager.setParameters(mediaItems, selectedIndex);
    playlistManager.setPlaylistId(PLAYLIST_ID);

    return true;
}

@sujitkjha
Copy link
Author

In AudioService Class I have changed something like this, now the problem is whichever list I selected first, audio get played from the same list, doesn't matter which playlist Item get clicked
int i= AudioPlayerActivity.playListNumber;
if(i==0) items = AudioItems.getItems();
else if(i==1) items=AudioItems.getNewRelease();

@brianwernick
Copy link
Owner

This is a more generic issue, and since I have already answered it you should post further questions like this on Stack Overflow or similar sites.

@sujitkjha
Copy link
Author

I have posted on stackoverflow here is the link http://stackoverflow.com/questions/36299033/exomedia-multiple-playlist-issue

I would really be very thanks full if you guide me a little.

Thank you :)

@sujitkjha
Copy link
Author

Thanks I have solved my problem, It was not possible if you have answered it before, I will update the code in SO soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants