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

Pause the player after completion #72

Closed
fumatamax opened this issue Sep 10, 2018 · 6 comments
Closed

Pause the player after completion #72

fumatamax opened this issue Sep 10, 2018 · 6 comments

Comments

@fumatamax
Copy link

I'm trying to pause the audio player once playback is complete. But I can't find any solution and I can't find the documentation that tells you how to pause once the audio is complete.

This is what I'm doing, but it gives me failure:

@Override
    public void onCompletedAudio() {
         player.pause();
    }

How can I fix this?

@jeancsanchez
Copy link
Owner

Did you set your activity as listener player.setJcPlayerManagerListener(this)?

@fumatamax
Copy link
Author

I haven't added player.setJcPlayerManagerListener(this)
could you give me an example of how once the audio has been completely heard, pause and don't jump to the next track

@fumatamax
Copy link
Author

fumatamax commented Sep 12, 2018

jeancsanchez could you give me an example to be able to apply the pause once the audio track is complete, thanks.

@fumatamax
Copy link
Author

Did you set your activity as listener player.setJcPlayerManagerListener(this)?

Excuse me, but could you give me a few examples. How to use player.setJcPlayerManagerListener(this)

@peace-shillong
Copy link

peace-shillong commented Sep 17, 2018

@fumatamax I know @jeancsanchez is busy...
P.S : "@jeancsanchez if you can read this please check my email, and can you kindly get back to me..."

You can use player.setJcPlayerManagerListener(this) or let your Class implement JcPlayerManagerListener
and override all the methods of the interface
And to Stop the Player you simply need these lines below
(You already have this method, so when your Class implement the JcPlayerManagerLister interface or set player.setJcPlayerManagerListener(this) in your onCreate method it should work )

@OverRide
public void onCompletedAudio() {
player.pause();
}

Just an update : i've tested the above code and it did not worked for me, so I added the player.pause in the onStopped() :a method implemented from the JcPlayerManagerListener interface and it should worked, but still i did not see any change...hope it works for you

@OverRide
public void onStopped(JcStatus status) {
player.pause();
}

@fumatamax
Copy link
Author

fumatamax commented Sep 18, 2018

Thank you very much @peace-shillong , excuse me for being so insistent. Tell you that I love your contribution to the community and that you continue with the project ahead.

I also wanted to ask you if you have the option to share the Player, I mean. Just as has the button to delete the Player, which has another button or the option to share.

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

3 participants