test fix
This commit is contained in:
parent
2099d3d64d
commit
9728906556
2 changed files with 16 additions and 4 deletions
|
|
@ -141,13 +141,15 @@ class PlaybackController extends StateNotifier<PlaybackState>
|
|||
required String? Function() serverKeyGetter,
|
||||
required void Function(Uri artUri) onArt,
|
||||
required void Function(Song song) onPlay,
|
||||
@visibleForTesting bool? audioEnabled,
|
||||
}) : _streamUriFor = streamUriFor,
|
||||
_coverArtUriFor = coverArtUriFor,
|
||||
_serverKeyGetter = serverKeyGetter,
|
||||
_onArt = onArt,
|
||||
_onPlay = onPlay,
|
||||
super(PlaybackState(supported: _audioSupported)) {
|
||||
if (_audioSupported) {
|
||||
_audioEnabled = audioEnabled ?? _audioSupported,
|
||||
super(PlaybackState(supported: audioEnabled ?? _audioSupported)) {
|
||||
if (_audioEnabled) {
|
||||
_player = AudioPlayer();
|
||||
_wireStreams();
|
||||
}
|
||||
|
|
@ -161,6 +163,12 @@ class PlaybackController extends StateNotifier<PlaybackState>
|
|||
final void Function(Uri artUri) _onArt;
|
||||
final void Function(Song song) _onPlay;
|
||||
|
||||
/// Whether a platform [AudioPlayer] was created. Defaults to [_audioSupported]
|
||||
/// but tests force it false so a headless CI host (macOS/iOS, where
|
||||
/// [_audioSupported] is true) doesn't touch uninitialized just_audio platform
|
||||
/// channels. The queue/state logic runs identically either way.
|
||||
final bool _audioEnabled;
|
||||
|
||||
AudioPlayer? _player;
|
||||
|
||||
final Random _random = Random();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue