Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
91be1aa
recreate ios + macos
Gustl22 Sep 19, 2025
5751988
downgrade Package.resolved version to 2
Gustl22 Sep 19, 2025
b7cd23c
fix: Properly dispose player on darwin
Gustl22 Oct 9, 2025
d4b8587
test: Use stream testing tools
Gustl22 Oct 9, 2025
1c67436
darwin
Gustl22 Oct 9, 2025
a9a2702
darwin dispose
Gustl22 Oct 9, 2025
2248e2a
async await
Gustl22 Oct 9, 2025
5d51077
async await
Gustl22 Oct 9, 2025
7dca16a
async await
Gustl22 Oct 9, 2025
317ffe9
async await
Gustl22 Oct 9, 2025
420c970
async await
Gustl22 Oct 9, 2025
66288f8
async await mainactor
Gustl22 Nov 25, 2025
f011ff5
runner xcscheme
Gustl22 Nov 25, 2025
14a4004
WIP: test
Gustl22 Nov 25, 2025
09cc86c
dispose stream order?
Gustl22 Nov 25, 2025
7db04ed
only dispose players
Gustl22 Nov 29, 2025
b2e99db
fix playing
Gustl22 Nov 29, 2025
c1017c2
fix test
Gustl22 Nov 29, 2025
0eb01ef
fix test
Gustl22 Jan 1, 2026
27a15da
some swift code change
Gustl22 Jan 1, 2026
66a0e1a
change order again
Gustl22 Jan 1, 2026
464bf21
swift format
Gustl22 Jan 2, 2026
970b221
ci: Upgrade macos runners
Gustl22 Jan 2, 2026
47bef0a
fix send onComplete event before next action
Gustl22 Jan 3, 2026
de8a264
do not seek in release mode
Gustl22 Jan 3, 2026
7ba352d
stop should lead to release in release mode
Gustl22 Jan 3, 2026
2d33c55
test concurrency=1
Gustl22 Jan 3, 2026
b92f2ca
format
Gustl22 Jan 3, 2026
a3e596a
Revert "test concurrency=1"
Gustl22 Jan 3, 2026
33f651f
test concurrency=1 again
Gustl22 Jan 3, 2026
ebe28db
Upgrade exoplayer version
Gustl22 Jan 4, 2026
60621c2
replace outdated hls live test
Gustl22 Jan 4, 2026
29f279d
fix settings source on android exo
Gustl22 Jan 4, 2026
1fe4e82
raise minSdkVersion
Gustl22 Jan 4, 2026
97157b3
remove uneffective concurrency flag
Gustl22 Jan 4, 2026
74b1122
minSdk
Gustl22 Jan 4, 2026
0d81f9f
raise min supported flutter version
Gustl22 Jan 4, 2026
a45587b
make testing lib tests more reliable
Gustl22 Jan 4, 2026
88da2ef
make testing lib tests more reliable attempt 2
Gustl22 Jan 6, 2026
40fb778
make testing lib tests more reliable attempt 3
Gustl22 Jan 10, 2026
1535b5b
increase timeout
Gustl22 Jan 11, 2026
55c4e2c
improve sequential testing
Gustl22 Jan 11, 2026
cb43530
skip some tests on old media player
Gustl22 Jan 11, 2026
bc5bb4e
more improvement on testing
Gustl22 Jan 11, 2026
9db86fa
lint
Gustl22 Jan 11, 2026
a6b8059
media error on other test
Gustl22 Jan 11, 2026
7bccd30
skip one more test
Gustl22 Jan 11, 2026
add044e
remove oncomplete on low latency
Gustl22 Jan 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_allow_trailing_comma = true
ij_kotlin_name_count_to_use_star_import = 999
ij_kotlin_name_count_to_use_star_import_for_members = 999

[*.swift]
indent_style = space
indent_size = 2
6 changes: 2 additions & 4 deletions .github/workflows/build-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:
- 'any'
- '3.35.x'
- '3.32.x'
- '3.29.x'
- '3.27.x'
flutter_channel:
description: 'Flutter Channel'
required: false
Expand Down Expand Up @@ -139,7 +137,7 @@ jobs:
run: flutter build apk --release

ios:
runs-on: macos-14
runs-on: macos-latest
timeout-minutes: 30
if: inputs.enable_ios
steps:
Expand All @@ -155,7 +153,7 @@ jobs:
run: flutter build ios --release --no-codesign

macos:
runs-on: macos-14
runs-on: macos-latest
timeout-minutes: 30
if: inputs.enable_macos
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
call-min-flutter-test:
uses: ./.github/workflows/test.yml
with:
flutter_version: '3.27.4'
flutter_version: '3.32.8'
fatal_warnings: false
enable_android: ${{ github.event.pull_request.draft == false }}
enable_web: ${{ github.event.pull_request.draft == false }}
Expand Down
31 changes: 14 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:
- 'any'
- '3.35.x'
- '3.32.x'
- '3.29.x'
- '3.27.x'
flutter_channel:
description: 'Flutter Channel'
required: false
Expand Down Expand Up @@ -208,9 +206,9 @@ jobs:
# Need to execute lib and app tests one by one, see: https://github.com/flutter/flutter/issues/101031
run: |
( cd server; dart run bin/server.dart ) &
flutter test integration_test/platform_test.dart --dart-define USE_LOCAL_SERVER=true --dart-define TEST_FEATURE_LOW_LATENCY=false --dart-define TEST_FEATURE_BYTES_SOURCE=false --dart-define TEST_FEATURE_PLAYBACK_RATE=false
flutter test integration_test/lib_test.dart --dart-define USE_LOCAL_SERVER=true --dart-define TEST_FEATURE_LOW_LATENCY=false --dart-define TEST_FEATURE_BYTES_SOURCE=false --dart-define TEST_FEATURE_PLAYBACK_RATE=false
flutter test integration_test/app_test.dart --dart-define USE_LOCAL_SERVER=true --dart-define TEST_FEATURE_LOW_LATENCY=false --dart-define TEST_FEATURE_BYTES_SOURCE=false --dart-define TEST_FEATURE_PLAYBACK_RATE=false
flutter test integration_test/platform_test.dart --dart-define USE_LOCAL_SERVER=true --dart-define TEST_FEATURE_LOW_LATENCY=false --dart-define TEST_FEATURE_BYTES_SOURCE=false --dart-define TEST_FEATURE_PLAYBACK_RATE=false --dart-define TEST_ANDROID_MEDIAPLAYER=true
flutter test integration_test/lib_test.dart --dart-define USE_LOCAL_SERVER=true --dart-define TEST_FEATURE_LOW_LATENCY=false --dart-define TEST_FEATURE_BYTES_SOURCE=false --dart-define TEST_FEATURE_PLAYBACK_RATE=false --dart-define TEST_ANDROID_MEDIAPLAYER=true
flutter test integration_test/app_test.dart --dart-define USE_LOCAL_SERVER=true --dart-define TEST_FEATURE_LOW_LATENCY=false --dart-define TEST_FEATURE_BYTES_SOURCE=false --dart-define TEST_FEATURE_PLAYBACK_RATE=false --dart-define TEST_ANDROID_MEDIAPLAYER=true

android-exo:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -258,17 +256,17 @@ jobs:
# Need to execute lib and app tests one by one, see: https://github.com/flutter/flutter/issues/101031
run: |
( cd server; dart run bin/server.dart ) &
flutter test integration_test/platform_test.dart --dart-define USE_LOCAL_SERVER=true
flutter test integration_test/lib_test.dart --dart-define USE_LOCAL_SERVER=true
flutter test integration_test/app_test.dart --dart-define USE_LOCAL_SERVER=true
flutter test integration_test/platform_test.dart --dart-define USE_LOCAL_SERVER=true --dart-define TEST_ANDROID_MEDIAPLAYER=true
flutter test integration_test/lib_test.dart --dart-define USE_LOCAL_SERVER=true --dart-define TEST_ANDROID_MEDIAPLAYER=true
flutter test integration_test/app_test.dart --dart-define USE_LOCAL_SERVER=true --dart-define TEST_ANDROID_MEDIAPLAYER=true
- name: Run Android unit tests
working-directory: ./packages/audioplayers/example/android
# TODO: Use `./gradlew test`, when https://github.com/flutter/flutter/issues/169336 is fixed.
run: ./gradlew testDebugUnitTest

ios-min:
# Run lib tests only to ensure compatibility with iOS 16.
runs-on: macos-13
runs-on: macos-latest
timeout-minutes: 60
if: inputs.enable_min_version && inputs.enable_ios
steps:
Expand All @@ -282,17 +280,16 @@ jobs:
- name: Run Flutter integration tests
working-directory: ./packages/audioplayers/example
run: |
sudo xcode-select -switch /Applications/Xcode_14.3.1.app/Contents/Developer
xcodes runtimes install "iOS 16.4"
UDID=$(xcrun simctl create test-se-16-4 com.apple.CoreSimulator.SimDeviceType.iPhone-SE-3rd-generation com.apple.CoreSimulator.SimRuntime.iOS-16-4)
xcrun simctl list devices
echo "Using simulator $UDID"
xcrun simctl boot "${UDID:?No Simulator with this name iPhone found}"
sudo xcode-select -switch /Applications/Xcode_15.2.app/Contents/Developer
( cd server; dart run bin/server.dart ) &
flutter test -d $UDID integration_test/lib_test.dart --dart-define USE_LOCAL_SERVER=true

ios:
runs-on: macos-14
runs-on: macos-26
timeout-minutes: 60
if: inputs.enable_ios
steps:
Expand All @@ -308,7 +305,7 @@ jobs:
working-directory: ./packages/audioplayers/example
# Need to execute lib and app tests one by one, see: https://github.com/flutter/flutter/issues/101031
run: |
UDID=$(xcrun simctl create test-se-17-2 com.apple.CoreSimulator.SimDeviceType.iPhone-SE-3rd-generation com.apple.CoreSimulator.SimRuntime.iOS-17-2)
UDID=$(xcrun simctl create test-se-26-2 com.apple.CoreSimulator.SimDeviceType.iPhone-SE-3rd-generation com.apple.CoreSimulator.SimRuntime.iOS-26-2)
xcrun simctl list devices
echo "Using simulator $UDID"
xcrun simctl boot "${UDID:?No Simulator with this name iPhone found}"
Expand All @@ -319,7 +316,7 @@ jobs:

# Remove as soon as support for cocoapods is removed at Flutter
ios-pods:
runs-on: macos-14
runs-on: macos-latest
timeout-minutes: 30
if: inputs.enable_ios
steps:
Expand All @@ -336,7 +333,7 @@ jobs:
run: flutter build ios --release --no-codesign

macos-min:
runs-on: macos-13
runs-on: macos-14
timeout-minutes: 30
if: inputs.enable_min_version && inputs.enable_macos
steps:
Expand All @@ -355,7 +352,7 @@ jobs:
flutter test -d macos integration_test/lib_test.dart --dart-define USE_LOCAL_SERVER=true

macos:
runs-on: macos-14
runs-on: macos-latest
timeout-minutes: 30
if: inputs.enable_macos
steps:
Expand All @@ -378,7 +375,7 @@ jobs:

# Remove as soon as support for cocoapods is removed at Flutter
macos-pods:
runs-on: macos-14
runs-on: macos-latest
timeout-minutes: 30
if: inputs.enable_macos
steps:
Expand Down
3 changes: 2 additions & 1 deletion packages/audioplayers/example/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ android {

defaultConfig {
applicationId = "xyz.luan.audioplayers.example"
minSdk = flutter.minSdkVersion
// TODO: Change back to `minSdk = flutter.minSdkVersion` when min supported Flutter version is 3.35.x.
minSdk = 23
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'dart:async';

import 'package:audioplayers_example/components/tgl.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';

import '../test_utils.dart';

extension AppWidgetTester on WidgetTester {
/// Wait until appearance and disappearance
Future<void> waitOneshot(
Expand All @@ -29,86 +29,6 @@ extension AppWidgetTester on WidgetTester {
);
}

// Add [stackTrace] to work around https://github.com/flutter/flutter/issues/89138
Future<void> waitFor(
Future<void> Function() testExpectation, {
Duration? timeout = const Duration(seconds: 15),
Duration? pollInterval = const Duration(milliseconds: 500),
String? stackTrace,
}) async =>
_waitUntil(
(setFailureMessage) async {
try {
await pump();
await testExpectation();
return true;
} on TestFailure catch (e) {
setFailureMessage(e.message ?? '');
return false;
}
},
timeout: timeout,
pollInterval: pollInterval,
stackTrace: stackTrace,
);

/// Waits until the [condition] returns true
/// Will raise a complete with a [TimeoutException] if the
/// condition does not return true with the timeout period.
/// Copied from: https://github.com/jonsamwell/flutter_gherkin/blob/02a4af91d7a2512e0a4540b9b1ab13e36d5c6f37/lib/src/flutter/utils/driver_utils.dart#L86
Future<void> _waitUntil(
Future<bool> Function(void Function(String message) setFailureMessage)
condition, {
Duration? timeout = const Duration(seconds: 15),
Duration? pollInterval = const Duration(milliseconds: 500),
String? stackTrace,
}) async {
var firstFailureMsg = '';
var lastFailureMsg = 'same as first failure';
void setFailureMessage(String message) {
if (firstFailureMsg.isEmpty) {
firstFailureMsg = '${DateTime.now()}:\n $message';
} else {
lastFailureMsg = '${DateTime.now()}:\n $message';
}
}

try {
await Future.microtask(
() async {
final completer = Completer<void>();
final maxAttempts =
(timeout!.inMilliseconds / pollInterval!.inMilliseconds).round();
var attempts = 0;

while (attempts < maxAttempts) {
final result = await condition(setFailureMessage);
if (result) {
completer.complete();
break;
} else {
await Future<void>.delayed(pollInterval);
}
attempts++;
}
},
).timeout(
timeout!,
);
} on TimeoutException catch (e) {
throw Exception(
'''$e

Stacktrace:
$stackTrace
First Failure:
$firstFailureMsg
Last Failure:
$lastFailureMsg''',
);
}
}

Future<void> scrollToAndTap(Key widgetKey) async {
await scrollTo(widgetKey);
await tap(find.byKey(widgetKey));
Expand Down
Loading