question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pause the player after completion

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
peace-shillongcommented, 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(); }

0reactions
fumatamaxcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The right way to pause a game in Unity - Game Dev Beginner
The most convenient method for pausing the game in Unity is by setting the game's time scale to zero (Time.timeScale = 0), which...
Read more >
Pause player after item change with ConcatenatingMediaSource
While playing videos from a ConcatenatingMediaSource playlist, I would like the player to pause automatically at the start of a new item eg....
Read more >
Pause Menu - GTA Wiki - Fandom
The Pause Menu is a screen that appears in every game in the Grand Theft Auto series. The pause menu appears whenever the...
Read more >
How can I pause the GTA 5 game? - Quora
You can pause the game by either pressing 'esc' (escape key) or the 'P' key on your keyboard. While you are in online,...
Read more >
How to insert a pause in between items in AVQueuePlayer?
I am using AVQueuePlayer to playback a batch of audio files. I'd like to insert a pause in between items. Any idea how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found