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

onPlayerComplete isn't working on Android in Loop mode #1675

Open
2 tasks done
define-private-public opened this issue Oct 17, 2023 · 3 comments
Open
2 tasks done

onPlayerComplete isn't working on Android in Loop mode #1675

define-private-public opened this issue Oct 17, 2023 · 3 comments
Labels
bug platform-android Affects the android platform

Comments

@define-private-public
Copy link

Checklist

  • I read the troubleshooting guide before raising this issue
  • I made sure that the issue I am raising doesn't already exist

Current bug behaviour

I added a a few listeners to my instance of AudioPlayer.onPlayerComplete stream. When playback has finished for a track, the event is being fired off for all platforms (Linux, macOS, iOS) except Android.

Expected behaviour

On Android, the handler I created for the AudioPlayer.onPlayerComplete event should be called when a track has reached the end.

With the snippet below, the Done message is printing on the console for all of the platforms except for Android.

Steps to reproduce

I am using a local MP3 file.

Code sample

Code sample
// ... 
    var player = AudioPlayer();
    player.setReleaseMode(ReleaseMode.loop);
    player.onPlayerComplete.listen(_on_playback_done);

// ..

  void _on_playback_done(final void _) async
  {
    print(''All done!');

    if (!loop_track)
    {
      // And reset the player back to the end
      await player.pause();
      await player.seek(Duration.zero);
    }
  }

Affected platforms

Android

Platform details

  • Android: Pixel 6 Pro w/ Android 14

AudioPlayers Version

5.2.0

Build mode

debug

Audio Files/URLs/Sources

No response

Screenshots

No response

Logs

No response

Related issues / more information

No response

Working on PR

no way

@Gustl22 Gustl22 changed the title onPlayerComplete isn't working on Android onPlayerComplete isn't working on Android in Loop mode Oct 26, 2023
@Gustl22 Gustl22 added the platform-android Affects the android platform label Oct 26, 2023
@Gustl22
Copy link
Collaborator

Gustl22 commented Oct 26, 2023

This is on loop mode only right? Then it probably needs adapting to the other platforms. But we currently transitioning to exoplayer in the near future, see #1526

@songyang-dev
Copy link

I am experiencing a similar issue on Android, but my release mode is stop. The audio works as intended on iOS but not on Android.

@songyang-dev
Copy link

Are you using this in low latency mode? It was the reason why it didn't work on my end. Low latency mode on Android does not support events

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug platform-android Affects the android platform
Projects
None yet
Development

No branches or pull requests

3 participants