bug fixes for android auto
This commit is contained in:
@@ -10,10 +10,6 @@ enum StreamingPlaybackStatus { stopped, buffering, playing }
|
||||
|
||||
class StreamingAudioBusinessObject extends ChangeNotifier {
|
||||
StreamingAudioBusinessObject() {
|
||||
if (_audioHandler == null && _audioHandlerInitFuture == null) {
|
||||
initializeBackgroundAudio();
|
||||
}
|
||||
|
||||
final initFuture = _audioHandlerInitFuture;
|
||||
if (initFuture != null) {
|
||||
initFuture.then((handler) {
|
||||
@@ -74,6 +70,10 @@ class StreamingAudioBusinessObject extends ChangeNotifier {
|
||||
String get currentTitle => _currentTitle;
|
||||
String get currentSubtitle => _currentSubtitle;
|
||||
|
||||
Future<void> ensureInitialized() async {
|
||||
await initializeBackgroundAudio();
|
||||
}
|
||||
|
||||
StreamingPlaybackStatus _mapPlaybackStateToStatus(PlaybackState state) {
|
||||
if (state.processingState == AudioProcessingState.completed) {
|
||||
return StreamingPlaybackStatus.stopped;
|
||||
|
||||
Reference in New Issue
Block a user