fix(platform): gate audio passthrough support
This commit is contained in:
@@ -210,6 +210,11 @@ class PlatformDetector {
|
|||||||
return Platform.isAndroid || Platform.isIOS || Platform.isMacOS || Platform.isLinux || Platform.isWindows;
|
return Platform.isAndroid || Platform.isIOS || Platform.isMacOS || Platform.isLinux || Platform.isWindows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool supportsAudioPassthrough() {
|
||||||
|
if (TvDetectionService._tvosBuild || isAppleTV()) return false;
|
||||||
|
return isDesktopOS() || (Platform.isAndroid && isTV());
|
||||||
|
}
|
||||||
|
|
||||||
static bool supportsPictureInPicture() {
|
static bool supportsPictureInPicture() {
|
||||||
return !TvDetectionService._tvosBuild && !isTV() && (Platform.isAndroid || Platform.isIOS || Platform.isMacOS);
|
return !TvDetectionService._tvosBuild && !isTV() && (Platform.isAndroid || Platform.isIOS || Platform.isMacOS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,14 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
group('SettingsService platform gates', () {
|
group('SettingsService platform gates', () {
|
||||||
|
test('audio passthrough stays available on desktop but not Apple TV', () {
|
||||||
|
expect(PlatformDetector.supportsAudioPassthrough(), isTrue);
|
||||||
|
|
||||||
|
TvDetectionService.debugSetAppleTVOverride(true);
|
||||||
|
|
||||||
|
expect(PlatformDetector.supportsAudioPassthrough(), isFalse);
|
||||||
|
});
|
||||||
|
|
||||||
test('forces external player off on Apple TV even when stored enabled', () async {
|
test('forces external player off on Apple TV even when stored enabled', () async {
|
||||||
final settings = await SettingsService.getInstance();
|
final settings = await SettingsService.getInstance();
|
||||||
await settings.write(SettingsService.useExternalPlayer, true);
|
await settings.write(SettingsService.useExternalPlayer, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user