From eee071d4d9b59291f1067f81beab40261d323617 Mon Sep 17 00:00:00 2001 From: yosemiteyss Date: Thu, 30 Mar 2023 10:55:33 +0800 Subject: [PATCH] update version to 1.2.5 --- CHANGELOG.md | 5 +++++ README.md | 12 ++++++++++++ lib/src/flutter_volume_controller.dart | 2 +- pubspec.yaml | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a971456..0f84ee6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.2.5 +* Added `getAndroidAudioStream` method. +* Added `getIOSAudioSessionCategory` method. +* Updated flutter_plugin_android_lifecycle plugin to 2.0.9. + ## 1.2.4 * Added `setIOSAudioSessionCategory` method. * Added `category` option to `addListener` method. diff --git a/README.md b/README.md index 7e8145f..689bebd 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,12 @@ await FlutterVolumeController.toggleMute(); await FlutterVolumeController.setAndroidAudioStream(stream: AudioStream.system); ``` +### Get Audio Stream on Android +- Get the current audio stream on Android. +```dart +final stream = await FlutterVolumeController.getAndroidAudioStream(); +``` + #### Set Audio Session Category on iOS - Adjusts to a different set of audio behaviors. - Supported categories: `AudioSessionCategory.ambient`, `AudioSessionCategory.multiRoute`, `AudioSessionCategory.playAndRecord`, `AudioSessionCategory.playback`, `AudioSessionCategory.record`, `AudioSessionCategory.soleAmbient` @@ -89,6 +95,12 @@ await FlutterVolumeController.setAndroidAudioStream(stream: AudioStream.system); await FlutterVolumeController.setIOSAudioSessionCategory(category: AudioSessionCategory.playback); ``` +#### Get Audio Session Category on iOS +- Get the current audio session category on iOS. +```dart +final category = await FlutterVolumeController.getIOSAudioSessionCategory(); +``` + #### Listen for Volume Changes - Use `emitOnStart` to control whether volume level should be emitted immediately right after the listener is attached. ```dart diff --git a/lib/src/flutter_volume_controller.dart b/lib/src/flutter_volume_controller.dart index 97153cf..7b1d539 100644 --- a/lib/src/flutter_volume_controller.dart +++ b/lib/src/flutter_volume_controller.dart @@ -200,7 +200,7 @@ class FlutterVolumeController { } } - /// Get the current audio session category on IOS. + /// Get the current audio session category on iOS. static Future getIOSAudioSessionCategory() async { if (Platform.isIOS) { final index = await methodChannel diff --git a/pubspec.yaml b/pubspec.yaml index 694e025..fb4ff78 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_volume_controller description: A Flutter plugin to control system volume and listen for volume changes on different platforms. -version: 1.2.4 +version: 1.2.5 homepage: https://github.com/yosemiteyss/flutter_volume_controller environment: