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:
parent
f4e9593d56
commit
28b4c16398
3 changed files with 26 additions and 1 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue