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

In Android, how to play follow the system's ring mode(ring volume, not media volume), AndroidUsageType.notificationRingtone is not effective #1849

Open
2 tasks done
yoer opened this issue Oct 15, 2024 · 0 comments
Labels

Comments

@yoer
Copy link

yoer commented Oct 15, 2024

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

In Android, how to follow the system's ring mode, that is, there is no sound in mute mode.

Currently, it changes with the media volume, not the ring volume.

Expected behaviour

sound of player is follow the system's ring mode

Steps to reproduce

  1. Execute flutter run on the code sample
  2. ...
  3. ...

Code sample

Code sample
    final audioContext = AudioContext(
      iOS: AudioContextIOS(
        category: AVAudioSessionCategory.soloAmbient,
      ),
      android: const AudioContextAndroid(
        isSpeakerphoneOn: true,
        stayAwake: true,
        contentType: AndroidContentType.music,
        usageType: AndroidUsageType.notificationRingtone,
        audioFocus: AndroidAudioFocus.gain,
      ),
    );
    AudioPlayer.global.setAudioContext(audioContext);

Affected platforms

Android

Platform details

No response

AudioPlayers Version

6.1.0

Build mode

debug

Audio Files/URLs/Sources

No response

Screenshots

No response

Logs

my relevant logs
Full Logs
my full logs or a link to a gist

Flutter doctor:

Output of: flutter doctor -v

Related issues / more information

No response

Working on PR

no way

@yoer yoer added the bug label Oct 15, 2024
@yoer yoer changed the title In Android, how to play follow the system's ring mode(call volume, not media volume) In Android, how to play follow the system's ring mode(ring volume, not media volume) Oct 16, 2024
@yoer yoer changed the title In Android, how to play follow the system's ring mode(ring volume, not media volume) In Android, how to play follow the system's ring mode(ring volume, not media volume), AndroidUsageType.notificationRingtone is not effective Oct 16, 2024
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

1 participant