gdelataillade / alarm

A Flutter plugin to easily manage alarms on iOS and Android
https://pub.dev/packages/alarm
MIT License
132 stars 86 forks source link

In the event of an alarm activation, it will stop another music player that is currently playing. #100

Closed pyjserv closed 11 months ago

pyjserv commented 1 year ago

Alarm plugin version 1.22 ~ 2.1.0

Describe the bug When the Flutter Alarm plugin is activated, it will stop another music player that is currently playing. However, the system alarm will not interrupt the music player.

Device info Android 8 and Android 13

gdelataillade commented 1 year ago

Hi @pyjserv,

Thanks for your interest in the package.

I'm not sure to understand your issue. The other music player is interrupted at the moment your alarm is set or when it starts ringing ?

pyjserv commented 1 year ago

Thanks for your reply. The other music player(MX Player Pro or Youtube) is interrupted at the moment when the alarm is ringing.

gdelataillade commented 1 year ago

OK. It's actually the excepted behavior. This way, you're sure to listen the alarm ring.

You think the alarm should play and let the other media play, with 2 audio playing at the same time ?

pyjserv commented 1 year ago

Hearing both audio sources or just the alarm sound is not a problem. The main inconvenience is that after the alarm ends, the user needs to manually replay the music player that was interrupted. If this is a to-do list app rather than a wake-up alarm, it can be a bit inconvenient for the user.

When the Android system alarm rings, indeed, no other music can be heard. However, after the Android system alarm ringing ends, the music resumes. Perhaps the Android system employs a method to mute other sounds temporarily to emphasize the alarm sound.

gdelataillade commented 1 year ago

I see. I'm currently refactoring completely the android part. I'll keep in mind your request.

Do you have the same issue with iOS ?

pyjserv commented 1 year ago

I see. I'm currently refactoring completely the android part. I'll keep in mind your request.

I'm glad to hear that. Thank you! :)

Do you have the same issue with iOS ?

I don't have an iOS device to test.

andyngdz commented 1 year ago

I see. I'm currently refactoring completely the android part. I'll keep in mind your request.

Do you have the same issue with iOS ?

Thanks for your work, I like this package. I'm working on iOS with audio_services, and just_audio.

I played a song and it shows on Media Control notifications, then I started an alarm and the Media Control disappear. I guess alarm is also playing a song on the background which causes the Media Control got removed?

gdelataillade commented 1 year ago

Hi @andyngdz

Thanks for your interest in the package !

That's interesting. Yes, the alarm plays a song on the background. I'll see if I put back your song on Media Control notification when alarm is stopped.

synstin commented 11 months ago

@gdelataillade

This is a feature I really need. I'm not looking for a wake-up call, but rather an app that alerts me when I complete a short task. Whenever a task is completed, the user stops the music or YouTube they were listening to. I want the notification to go off and not affect the music or YouTube at all. If there is anything I can do temporarily before this is fixed, I would really appreciate it.

gdelataillade commented 11 months ago

@synstin

I just answered in the discussion #104