bug fixes for android auto
This commit is contained in:
+10
-6
@@ -13,13 +13,16 @@ import 'streaming_audio_business_object.dart';
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
tz.initializeTimeZones();
|
||||
unawaited(StreamingAudioBusinessObject.initializeBackgroundAudio());
|
||||
await SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.portraitUp,
|
||||
DeviceOrientation.portraitDown,
|
||||
]);
|
||||
|
||||
runApp(const MyApp());
|
||||
|
||||
// Keep startup non-blocking so UI can render even if background media
|
||||
// services are initializing after an Android Auto cold start.
|
||||
unawaited(
|
||||
SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.portraitUp,
|
||||
DeviceOrientation.portraitDown,
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
@@ -36,6 +39,7 @@ class _MyAppState extends State<MyApp> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
unawaited(_audio.ensureInitialized());
|
||||
_casting.initialize();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user