fix black overlay during rebuffers and bump native player fork

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tommy Chow 2026-03-15 16:47:15 -07:00
parent f4e9593d56
commit 28b4c16398
3 changed files with 26 additions and 1 deletions

View file

@ -31,7 +31,7 @@ class NativeVideo extends StatelessWidget {
key: ObjectKey(controller),
controller: controller,
),
if (controller != null && nativeVideoStore.loading && !isOffline)
if (controller != null && !nativeVideoStore.hasPlayedOnce && !isOffline)
const ColoredBox(
color: Colors.black,
child: SizedBox.expand(),

View file

@ -74,6 +74,9 @@ abstract class NativeVideoStoreBase with Store implements VideoPlayerInterface {
@readonly
var _paused = true;
@readonly
var _hasPlayedOnce = false;
@readonly
var _overlayVisible = true;
@ -299,6 +302,7 @@ abstract class NativeVideoStoreBase with Store implements VideoPlayerInterface {
case PlayerActivityState.playing:
_loading = false;
_paused = false;
_hasPlayedOnce = true;
_initializing = false;
_isQualitySwitching = false;
_stallRecoveryTimer?.cancel();
@ -534,6 +538,7 @@ abstract class NativeVideoStoreBase with Store implements VideoPlayerInterface {
}
_loading = true;
_paused = true;
_hasPlayedOnce = false;
_userPaused = false;
_stallRecoveryAttempt = 0;
_highLatencyCount = 0;

View file

@ -77,6 +77,26 @@ mixin _$NativeVideoStore on NativeVideoStoreBase, Store {
});
}
late final _$_hasPlayedOnceAtom = Atom(
name: 'NativeVideoStoreBase._hasPlayedOnce',
context: context,
);
bool get hasPlayedOnce {
_$_hasPlayedOnceAtom.reportRead();
return super._hasPlayedOnce;
}
@override
bool get _hasPlayedOnce => hasPlayedOnce;
@override
set _hasPlayedOnce(bool value) {
_$_hasPlayedOnceAtom.reportWrite(value, super._hasPlayedOnce, () {
super._hasPlayedOnce = value;
});
}
late final _$_overlayVisibleAtom = Atom(
name: 'NativeVideoStoreBase._overlayVisible',
context: context,