Skip to content

Commit

Permalink
Merge pull request #39 from yosemiteyss/feat/update-1.2.5
Browse files Browse the repository at this point in the history
update version to 1.2.5
  • Loading branch information
yosemiteyss authored Mar 30, 2023
2 parents f5d70a6 + eee071d commit 2470874
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/src/flutter_volume_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class FlutterVolumeController {
}
}

/// Get the current audio session category on IOS.
/// Get the current audio session category on iOS.
static Future<AudioSessionCategory?> getIOSAudioSessionCategory() async {
if (Platform.isIOS) {
final index = await methodChannel
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 2470874

Please sign in to comment.