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

Not playing next song #11

Open
amitiwary999 opened this issue Sep 28, 2016 · 8 comments
Open

Not playing next song #11

amitiwary999 opened this issue Sep 28, 2016 · 8 comments
Labels

Comments

@amitiwary999
Copy link

amitiwary999 commented Sep 28, 2016

Player is not able to play next song automatically.User have to click next song to play it.Nice job.Thank you

@ryanhoo
Copy link
Owner

ryanhoo commented Sep 28, 2016

Check the play mode, there are four play mode available: single, loop, shuffle, list. Only the list mode will stop when the list is finished playing.

@amitiwary999
Copy link
Author

amitiwary999 commented Sep 28, 2016

I checked it already and on clicking next button it is not playing next song.

@JerryMissTom
Copy link

yes, in any play mode, the playing song will start from the beginning if you click next or pre button

@JerryMissTom
Copy link

in class Player, the method playNext() or playLast() will go to method play(), and in method play(), it get current song and play it ,not the last song or next. so the pre and next button will not response.
在Player类中,方法playNext() 和playLast()中获取了nextSong 和lastSong,但是,并没有传给调用的play()方法,而play()方法获取的是currentSong,,所以上一首和下一首按钮不起作用

@ryanhoo ryanhoo added the bug label Sep 29, 2016
@DroidPulkit
Copy link
Contributor

Is there a way in which I can contribute to this code base specially this bug?

@ryanhoo
Copy link
Owner

ryanhoo commented Sep 30, 2016

@DroidPulkit You fork this project, fix this bug, launch a pull request.

@JerryMissTom
Copy link

I fix this bug in my way, it will only play last or next song in the same playlist. In class Play, I add some code like as follows:
image
image

if you have better idea, please inform me

@nillbiplob
Copy link

But it wasn't working for "All" playlist. So I fixed the bug by adding following code...

At PlayList.java

public static PlayList fromLocalPlaylist(String name, List songs, int numOfSongs, int playingIndex) {
PlayList playList = new PlayList();
playList.setName(name);
playList.setSongs(songs);
playList.setNumOfSongs(numOfSongs);
playList.setPlayingIndex(playingIndex);

    return playList;
}

AllLocalMusicFragment.java

mAdapter.setOnItemClickListener(new OnItemClickListener() {
@OverRide
public void onItemClick(int position) {
// Song song = mAdapter.getItem(position);
//RxBus.getInstance().post(new PlaySongEvent(song));
// previous code was responsible for single song play

            /*
            new code by Biplob to play full playlist from "All" list.
             */

            PlayList playList =PlayList.fromLocalPlaylist(getString(R.string.mp_local_files_segmented_all),mAdapter.getData(),mAdapter.getData().size(),position);


            Log.e("Song in init playlist", playList.getNumOfSongs()+" total");

            RxBus.getInstance().post(new PlayListNowEvent(playList, position));

        }
    });

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

No branches or pull requests

5 participants