mod: 修改触发全屏手势

This commit is contained in:
guozhigq
2023-08-05 08:43:34 +08:00
parent 8a59b05777
commit 7636eb1753

View File

@ -504,12 +504,14 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
final double dy = details.delta.dy; final double dy = details.delta.dy;
const double threshold = 7.0; // 滑动阈值 const double threshold = 7.0; // 滑动阈值
if (dy > _distance && dy > threshold) { if (dy > _distance && dy > threshold) {
if (!_.isFullScreen.value) { if (_.isFullScreen.value) {
// 下滑退出全屏
await triggerFullScreen(); await triggerFullScreen();
} }
_distance = 0.0; _distance = 0.0;
} else if (dy < _distance && dy < -threshold) { } else if (dy < _distance && dy < -threshold) {
if (_.isFullScreen.value) { if (!_.isFullScreen.value) {
// 上滑进入全屏
await triggerFullScreen(); await triggerFullScreen();
} }
_distance = 0.0; _distance = 0.0;