Skip to content

Commit

Permalink
Merge pull request #80 from FrankGoyens/notification_stream
Browse files Browse the repository at this point in the history
Add support for STREAM_NOTIFICATION
  • Loading branch information
yosemiteyss authored Nov 12, 2024
2 parents 6dd623d + 50c6602 commit 56960dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ await FlutterVolumeController.toggleMute();
#### Set Audio Stream on Android
- Adjusts to the audio stream whose volume should be changed by the hardware volume controls.
- Supported streams: `AudioStream.voiceCall`, `AudioStream.system`, `AudioStream.ring`
, `AudioStream.music`, `AudioStream.alarm`.
, `AudioStream.music`, `AudioStream.alarm`, `AudioStream.notification`.
- For more details,
visit [AudioManager](https://developer.android.com/reference/android/media/AudioManager)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ enum class AudioStream {
SYSTEM,
RING,
MUSIC,
ALARM;
ALARM,
NOTIFICATION;

val streamType: Int
get() {
Expand All @@ -17,6 +18,7 @@ enum class AudioStream {
RING -> AudioManager.STREAM_RING
MUSIC -> AudioManager.STREAM_MUSIC
ALARM -> AudioManager.STREAM_ALARM
NOTIFICATION -> AudioManager.STREAM_NOTIFICATION
}
}
}
2 changes: 2 additions & 0 deletions lib/src/audio_stream.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
/// [AudioStream.ring] refers to AudioManager.STREAM_RING.
/// [AudioStream.music] refers to AudioManager.STREAM_MUSIC.
/// [AudioStream.alarm] refers to AudioManager.STREAM_ALARM.
/// [AudioStream.notification] refers to AudioManager.STREAM_NOTIFICATION.
enum AudioStream {
voiceCall,
system,
ring,
music,
alarm,
notification,
}

0 comments on commit 56960dc

Please sign in to comment.