fix(android): apply dv conversion mode during init
This commit is contained in:
@@ -195,7 +195,15 @@ class PlayerAndroid extends PlayerBase {
|
||||
break;
|
||||
case 'dv-conversion-mode':
|
||||
_dvConversionMode = value;
|
||||
if (initialized) await invoke('setDvConversionMode', {'mode': value});
|
||||
final initFuture = _initFuture;
|
||||
if (initialized) {
|
||||
await invoke('setDvConversionMode', {'mode': value});
|
||||
} else if (initFuture != null) {
|
||||
await initFuture;
|
||||
if (!disposed && initialized && _dvConversionMode == value) {
|
||||
await invoke('setDvConversionMode', {'mode': value});
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'sub-visibility':
|
||||
if (value == 'no') {
|
||||
|
||||
@@ -566,13 +566,6 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
player = currentPlayer;
|
||||
_playerBackendLabel = currentPlayer.playerType;
|
||||
|
||||
// Kick off audio-focus negotiation in parallel with MPV config + prefetch.
|
||||
// On Android this is a round-trip to AudioManager (~90ms cold).
|
||||
if (Platform.isAndroid && !widget.isLive) {
|
||||
_audioFocusFuture = currentPlayer.requestAudioFocus();
|
||||
_audioFocusFuture!.ignore();
|
||||
}
|
||||
|
||||
// Kick off getPlaybackData() in parallel with the rest of MPV setup.
|
||||
// The network/DB work has no dependency on the player — it just needs
|
||||
// the context (providers), which is still safe to touch here because
|
||||
@@ -670,6 +663,12 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
}
|
||||
}
|
||||
}
|
||||
// requestAudioFocus initializes Android players, so start it only after
|
||||
// init-time ExoPlayer options above have been cached.
|
||||
if (Platform.isAndroid && !widget.isLive) {
|
||||
_audioFocusFuture = currentPlayer.requestAudioFocus();
|
||||
_audioFocusFuture!.ignore();
|
||||
}
|
||||
await currentPlayer.setProperty('msg-level', debugLoggingEnabled ? 'all=debug' : 'all=error');
|
||||
await currentPlayer.setLogLevel(debugLoggingEnabled ? 'v' : 'warn');
|
||||
await currentPlayer.setProperty('hwdec', _getHwdecValue(enableHardwareDecoding));
|
||||
|
||||
Reference in New Issue
Block a user