Skip to content

Commit

Permalink
Merge branch 'feature/topics' into minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanheise committed May 15, 2023
2 parents 097e04d + 126911d commit 8f92869
Show file tree
Hide file tree
Showing 23 changed files with 97 additions and 173 deletions.
4 changes: 4 additions & 0 deletions just_audio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.33

* Update minimum flutter version to 3.0.

## 0.9.32

* Fix ignored tag parameter in AudioSource.asset().
Expand Down
7 changes: 4 additions & 3 deletions just_audio/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
include: package:flutter_lints/flutter.yaml

analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
language:
strict-casts: true
strict-inference: true
strict-raw-types: true

linter:
rules:
Expand Down
2 changes: 1 addition & 1 deletion just_audio/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
4 changes: 2 additions & 2 deletions just_audio/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ description: Demonstrates how to use the just_audio plugin.
publish_to: 'none'

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.14.0 <4.0.0"

dependencies:
flutter:
sdk: flutter
audio_session: ^0.1.11
audio_session: ^0.1.14
rxdart: ^0.27.7
just_audio_mpv: ^0.1.6
just_audio_windows: ^0.2.0
Expand Down
16 changes: 8 additions & 8 deletions just_audio/lib/just_audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ class AudioPlayer {
/// implementation. When switching between active and inactive modes, this is
/// used to cancel the subscription to the previous platform's events and
/// subscribe to the new platform's events.
StreamSubscription? _playbackEventSubscription;
StreamSubscription<PlaybackEventMessage>? _playbackEventSubscription;

/// The subscription to the data event channel of the current platform
/// implementation. When switching between active and inactive modes, this is
/// used to cancel the subscription to the previous platform's events and
/// subscribe to the new platform's events.
StreamSubscription? _playerDataSubscription;
StreamSubscription<PlayerDataMessage>? _playerDataSubscription;

final String _id;
final _proxy = _ProxyHttpServer();
Expand Down Expand Up @@ -614,8 +614,8 @@ class AudioPlayer {
}

Timer? currentTimer;
StreamSubscription? durationSubscription;
StreamSubscription? playbackEventSubscription;
StreamSubscription<Duration?>? durationSubscription;
StreamSubscription<PlaybackEvent>? playbackEventSubscription;
void yieldPosition(Timer timer) {
if (controller.isClosed) {
timer.cancel();
Expand Down Expand Up @@ -1992,13 +1992,13 @@ class _ProxyHttpServer {
String _requestKey(Uri uri) => '${uri.path}?${uri.query}';

/// Start the server if it is not already running.
Future ensureRunning() async {
Future<dynamic> ensureRunning() async {
if (_running) return;
return await start();
}

/// Starts the server.
Future start() async {
Future<dynamic> start() async {
_running = true;
_server = await HttpServer.bind(InternetAddress.loopbackIPv4, 0);
_server.listen((request) async {
Expand All @@ -2015,7 +2015,7 @@ class _ProxyHttpServer {
}

/// Stops the server
Future stop() async {
Future<dynamic> stop() async {
if (!_running) return;
_running = false;
return await _server.close();
Expand Down Expand Up @@ -2841,7 +2841,7 @@ class LockCachingAudioSource extends StreamAudioSource {
final mimeFile = await _mimeFile;
await mimeFile.writeAsString(mimeType);
final inProgressResponses = <_InProgressCacheResponse>[];
late StreamSubscription subscription;
late StreamSubscription<List<int>> subscription;
var percentProgress = 0;
void updateProgress(int newPercentProgress) {
if (newPercentProgress != percentProgress) {
Expand Down
17 changes: 11 additions & 6 deletions just_audio/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
name: just_audio
description: A feature-rich audio player for Flutter. Loop, clip and concatenate any sound from any source (asset/file/URL/stream) in a variety of audio formats with gapless playback.
version: 0.9.32
version: 0.9.33
repository: https://github.com/ryanheise/just_audio/tree/minor/just_audio
issue_tracker: https://github.com/ryanheise/just_audio/issues
topics:
- audio
- sound
- player
- background

environment:
sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.12.13+hotfix.5"
sdk: ">=2.14.0 <4.0.0"
flutter: ">=3.0.0"

dependencies:
just_audio_platform_interface: ^4.2.0
just_audio_platform_interface: ^4.2.1
# just_audio_platform_interface:
# path: ../just_audio_platform_interface
just_audio_web: ^0.4.7
just_audio_web: ^0.4.8
# just_audio_web:
# path: ../just_audio_web
audio_session: ^0.1.11
audio_session: ^0.1.14
rxdart: '>=0.26.0 <0.28.0'
path: ^1.8.0
path_provider: ^2.0.0
Expand Down
21 changes: 14 additions & 7 deletions just_audio/test/just_audio_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,18 @@ void runTests() {
}

setUp(() {
audioSessionChannel.setMockMethodCallHandler((MethodCall methodCall) async {
_ambiguate(TestDefaultBinaryMessengerBinding.instance)!
.defaultBinaryMessenger
.setMockMethodCallHandler(audioSessionChannel,
(MethodCall methodCall) async {
return null;
});
});

tearDown(() {
audioSessionChannel.setMockMethodCallHandler(null);
_ambiguate(TestDefaultBinaryMessengerBinding.instance)!
.defaultBinaryMessenger
.setMockMethodCallHandler(audioSessionChannel, null);
});

test('init', () async {
Expand Down Expand Up @@ -346,7 +351,7 @@ void runTests() {
stopwatch.start();

var completer = Completer<dynamic>();
late StreamSubscription subscription;
late StreamSubscription<Duration> subscription;
subscription = player.positionStream.listen((position) {
if (position >= position1) {
subscription.cancel();
Expand Down Expand Up @@ -1091,7 +1096,7 @@ void runTests() {
playing: false,
);
var completer = Completer<dynamic>();
late StreamSubscription subscription;
late StreamSubscription<Duration> subscription;
subscription = player.positionStream.listen((position) {
expectDuration(position, Duration.zero);
subscription.cancel();
Expand Down Expand Up @@ -1170,7 +1175,7 @@ void runTests() {
);
expect(player.currentIndex, 0);
var completer = Completer<dynamic>();
late StreamSubscription subscription;
late StreamSubscription<Duration> subscription;
subscription = player.positionStream.listen((position) {
expectDuration(position, Duration.zero);
subscription.cancel();
Expand Down Expand Up @@ -1743,7 +1748,7 @@ class MockWebServer {
late HttpServer _server;
int get port => _server.port;

Future start() async {
Future<void> start() async {
_server = await HttpServer.bind(InternetAddress.loopbackIPv4, 0);
_server.listen((request) async {
final response = request.response;
Expand All @@ -1766,7 +1771,9 @@ class MockWebServer {
});
}

Future stop() => _server.close();
Future<void> stop() => _server.close();
}

class MyHttpOverrides extends HttpOverrides {}

T? _ambiguate<T>(T? value) => value;
1 change: 1 addition & 0 deletions just_audio_background/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 0.0.1-beta.10

* Fix bug where AudioPlayer constructor parameters were ignored.
* Update minimum flutter version to 3.0.

## 0.0.1-beta.9

Expand Down
7 changes: 4 additions & 3 deletions just_audio_background/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
include: package:flutter_lints/flutter.yaml

analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
language:
strict-casts: true
strict-inference: true
strict-raw-types: true

linter:
rules:
Expand Down
2 changes: 1 addition & 1 deletion just_audio_background/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
55 changes: 0 additions & 55 deletions just_audio_background/example/ios/Podfile.lock

This file was deleted.

2 changes: 1 addition & 1 deletion just_audio_background/example/lib/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class SeekBarState extends State<SeekBar> {
.firstMatch("$_remaining")
?.group(1) ??
'$_remaining',
style: Theme.of(context).textTheme.caption),
style: Theme.of(context).textTheme.bodySmall),
),
],
);
Expand Down
4 changes: 2 additions & 2 deletions just_audio_background/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class MyAppState extends State<MyApp> {
),
),
Text(metadata.album!,
style: Theme.of(context).textTheme.headline6),
style: Theme.of(context).textTheme.titleLarge),
Text(metadata.title),
],
);
Expand Down Expand Up @@ -199,7 +199,7 @@ class MyAppState extends State<MyApp> {
Expanded(
child: Text(
"Playlist",
style: Theme.of(context).textTheme.headline6,
style: Theme.of(context).textTheme.titleLarge,
textAlign: TextAlign.center,
),
),
Expand Down
55 changes: 0 additions & 55 deletions just_audio_background/example/macos/Podfile.lock

This file was deleted.

4 changes: 2 additions & 2 deletions just_audio_background/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ description: Demonstrates how to use the just_audio plugin.
publish_to: 'none'

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.14.0 <4.0.0"

dependencies:
flutter:
sdk: flutter
audio_session: ^0.1.7
audio_session: ^0.1.14
rxdart: ^0.27.2
just_audio:
path: ../../just_audio
Expand Down
Loading

0 comments on commit 8f92869

Please sign in to comment.