Skip to content

Commit

Permalink
[audioplayers] Update audioplayers to 5.1.0 (flutter-tizen#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swanseo0 authored Aug 31, 2023
1 parent 05918a7 commit 10ea31d
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 14 deletions.
6 changes: 6 additions & 0 deletions packages/audioplayers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 3.0.1

* Update audioplayers to 5.1.0.
* Update audioplayers_platform_interface to 6.0.0.
* Update example app.

## 3.0.0

* Update audioplayers to 4.1.0.
Expand Down
5 changes: 3 additions & 2 deletions packages/audioplayers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This package is not an _endorsed_ implementation of `audioplayers`. Therefore, y

```yaml
dependencies:
audioplayers: ^4.1.0
audioplayers_tizen: ^3.0.0
audioplayers: ^5.1.0
audioplayers_tizen: ^3.0.1

```

Expand Down Expand Up @@ -51,6 +51,7 @@ For detailed information on Tizen privileges, see [Tizen Docs: API Privileges](h
- [x] `AudioPlayer.resume`
- [x] `AudioPlayer.release`
- [x] `AudioPlayer.seek`
- [ ] `AudioPlayer.setBalance` (not supported)
- [x] `AudioPlayer.setVolume`
- [x] `AudioPlayer.setReleaseMode`
- [x] `AudioPlayer.setPlaybackRate`
Expand Down
Binary file not shown.
Binary file added packages/audioplayers/example/assets/coins.wav
Binary file not shown.
1 change: 1 addition & 0 deletions packages/audioplayers/example/assets/invalid.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This represents an invalid audio file.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,30 @@ class _PropertiesWidgetState extends State<PropertiesWidget> {
subtitle: const Text('Source'),
leading: const Icon(Icons.audio_file),
),
ListTile(
title: Text(
widget.player.volume.toString(),
key: const Key('volumeText'),
),
subtitle: const Text('Volume'),
leading: const Icon(Icons.volume_up),
),
ListTile(
title: Text(
widget.player.balance.toString(),
key: const Key('balanceText'),
),
subtitle: const Text('Balance'),
leading: const Icon(Icons.balance),
),
ListTile(
title: Text(
widget.player.playbackRate.toString(),
key: const Key('playbackRateText'),
),
subtitle: const Text('Playback Rate'),
leading: const Icon(Icons.speed),
),
],
);
}
Expand Down
15 changes: 9 additions & 6 deletions packages/audioplayers/example/lib/tabs/audio_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,14 @@ class AudioContextTabState extends State<AudioContextTab>
Widget _genericTab() {
return TabContent(
children: [
Cbx(
'Force Speaker',
value: audioContextConfig.forceSpeaker,
({value}) =>
updateConfig(audioContextConfig.copy(forceSpeaker: value)),
LabeledDropDown<AudioContextConfigRoute>(
label: 'Audio Route',
key: const Key('audioRoute'),
options: {for (final e in AudioContextConfigRoute.values) e: e.name},
selected: audioContextConfig.route,
onChange: (v) => updateConfig(
audioContextConfig.copy(route: v),
),
),
Cbx(
'Duck Audio',
Expand Down Expand Up @@ -191,7 +194,7 @@ class AudioContextTabState extends State<AudioContextTab>
Widget _iosTab() {
final iosOptions = AVAudioSessionOptions.values.map(
(option) {
final options = audioContext.iOS.options.toList();
final options = audioContext.iOS.options;
return Cbx(
option.name,
value: options.contains(option),
Expand Down
6 changes: 3 additions & 3 deletions packages/audioplayers/example/lib/tabs/sources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:audioplayers_tizen_example/utils.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart';
import 'package:http/http.dart' as http;

final localhost = kIsWeb || !Platform.isAndroid ? 'localhost' : '10.0.2.2';
const host = 'https://luan.xyz';
Expand Down Expand Up @@ -86,7 +86,7 @@ class _SourcesTabState extends State<SourcesTab>
Future<void> Function(Source) fun, {
required String url,
}) async {
final bytes = await readBytes(Uri.parse(url));
final bytes = await http.readBytes(Uri.parse(url));
await fun(BytesSource(bytes));
}

Expand Down Expand Up @@ -117,7 +117,7 @@ class _SourcesTabState extends State<SourcesTab>
),
_createSourceTile(
setSourceKey: const Key('setSource-url-remote-mp3-1'),
title: 'Remote URL MP3 1',
title: 'Remote URL MP3 1 (VBR)',
subtitle: 'ambient_c_motion.mp3',
source: UrlSource(mp3Url1),
),
Expand Down
2 changes: 1 addition & 1 deletion packages/audioplayers/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ environment:
flutter: ">=3.3.0"

dependencies:
audioplayers: ^4.1.0
audioplayers: ^5.1.0
audioplayers_tizen:
path: ../
collection: ^1.16.0
Expand Down
4 changes: 2 additions & 2 deletions packages/audioplayers/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: audioplayers_tizen
description: Tizen implementation of the audioplayers plugin.
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/audioplayers
version: 3.0.0
version: 3.0.1

environment:
sdk: ">=2.18.0 <4.0.0"
Expand All @@ -16,7 +16,7 @@ flutter:
fileName: audioplayers_tizen_plugin.h

dependencies:
audioplayers_platform_interface: ^5.0.1
audioplayers_platform_interface: ^6.0.0
flutter:
sdk: flutter

Expand Down

0 comments on commit 10ea31d

Please sign in to comment.