mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-11 09:27:30 +00:00
this change fixes the garbled audio on my Pixel 6a while the screen is off. Not familiar with libmpv, but seems to favor audiotrack audio output over opensles. KRTirtho/spotube#571
This commit is contained in:
parent
5d0b5e69a5
commit
0e73443471
@ -1,5 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'package:flutter_desktop_tools/flutter_desktop_tools.dart';
|
||||||
import 'package:catcher_2/catcher_2.dart';
|
import 'package:catcher_2/catcher_2.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:media_kit/media_kit.dart';
|
import 'package:media_kit/media_kit.dart';
|
||||||
@ -64,6 +64,12 @@ class MkPlayerWithState extends Player {
|
|||||||
Catcher2.reportCheckedError('[MediaKitError] \n$event', null);
|
Catcher2.reportCheckedError('[MediaKitError] \n$event', null);
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
if (super.platform is NativePlayer) {
|
||||||
|
NativePlayer playerNative = super.platform as NativePlayer;
|
||||||
|
if (DesktopTools.platform.isAndroid) {
|
||||||
|
playerNative.setProperty("ao", "audiotrack,opensles");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get shuffled => _shuffled;
|
bool get shuffled => _shuffled;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user