mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-28 06:20:12 +08:00
@@ -115,9 +115,12 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
|||||||
@override
|
@override
|
||||||
Future<void> didPopNext() async {
|
Future<void> didPopNext() async {
|
||||||
addObserverMobile(this);
|
addObserverMobile(this);
|
||||||
plPlayerController
|
if (!plPlayerController.isLive) {
|
||||||
..isLive = true
|
plPlayerController.isLive = true;
|
||||||
..danmakuController = _liveRoomController.danmakuController;
|
_liveRoomController.isLoaded.refresh();
|
||||||
|
}
|
||||||
|
plPlayerController.danmakuController =
|
||||||
|
_liveRoomController.danmakuController;
|
||||||
PlPlayerController.setPlayCallBack(plPlayerController.play);
|
PlPlayerController.setPlayCallBack(plPlayerController.play);
|
||||||
_liveRoomController.startLiveTimer();
|
_liveRoomController.startLiveTimer();
|
||||||
if (plPlayerController.playerStatus.isPlaying &&
|
if (plPlayerController.playerStatus.isPlaying &&
|
||||||
@@ -242,9 +245,6 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
|||||||
Alignment alignment = Alignment.center,
|
Alignment alignment = Alignment.center,
|
||||||
bool needDm = true,
|
bool needDm = true,
|
||||||
}) {
|
}) {
|
||||||
if (!plPlayerController.isLive) {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
if (!isFullScreen && !plPlayerController.isDesktopPip) {
|
if (!isFullScreen && !plPlayerController.isDesktopPip) {
|
||||||
_liveRoomController.fsSC.value = null;
|
_liveRoomController.fsSC.value = null;
|
||||||
}
|
}
|
||||||
@@ -252,7 +252,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
|||||||
Widget player = Obx(
|
Widget player = Obx(
|
||||||
key: playerKey,
|
key: playerKey,
|
||||||
() {
|
() {
|
||||||
if (_liveRoomController.isLoaded.value) {
|
if (_liveRoomController.isLoaded.value && plPlayerController.isLive) {
|
||||||
final roomInfoH5 = _liveRoomController.roomInfoH5.value;
|
final roomInfoH5 = _liveRoomController.roomInfoH5.value;
|
||||||
return PLVideoPlayer(
|
return PLVideoPlayer(
|
||||||
maxWidth: width,
|
maxWidth: width,
|
||||||
|
|||||||
@@ -267,7 +267,10 @@ class VideoDetailController extends GetxController
|
|||||||
final isVertical = height > width;
|
final isVertical = height > width;
|
||||||
if (_scrollCtr?.hasClients != true) {
|
if (_scrollCtr?.hasClients != true) {
|
||||||
videoHeight = isVertical ? maxVideoHeight : minVideoHeight;
|
videoHeight = isVertical ? maxVideoHeight : minVideoHeight;
|
||||||
this.isVertical.value = isVertical;
|
if (this.isVertical.value != isVertical) {
|
||||||
|
this.isVertical.value = isVertical;
|
||||||
|
_needAnimOnDimensionChanged(isVertical);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.isVertical.value != isVertical) {
|
if (this.isVertical.value != isVertical) {
|
||||||
|
|||||||
@@ -362,7 +362,6 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
late final keyboardControl = Pref.keyboardControl;
|
late final keyboardControl = Pref.keyboardControl;
|
||||||
late final uiScale = Pref.uiScale;
|
late final uiScale = Pref.uiScale;
|
||||||
|
|
||||||
|
|
||||||
late final bool autoEnterFullScreen = Pref.autoEnterFullScreen;
|
late final bool autoEnterFullScreen = Pref.autoEnterFullScreen;
|
||||||
late final bool autoExitFullscreen = Pref.autoExitFullscreen;
|
late final bool autoExitFullscreen = Pref.autoExitFullscreen;
|
||||||
late final bool autoPlayEnable = Pref.autoPlayEnable;
|
late final bool autoPlayEnable = Pref.autoPlayEnable;
|
||||||
|
|||||||
@@ -1211,7 +1211,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
|
|
||||||
StreamSubscription<bool>? _danmakuListener;
|
StreamSubscription<bool>? _danmakuListener;
|
||||||
|
|
||||||
static const _kOffsetThreshold = 40.0;
|
static const _kOffsetThreshold = 30.0;
|
||||||
bool _isPositionAllowed(Offset offset) {
|
bool _isPositionAllowed(Offset offset) {
|
||||||
if (offset.dx < _kOffsetThreshold ||
|
if (offset.dx < _kOffsetThreshold ||
|
||||||
offset.dy < _kOffsetThreshold ||
|
offset.dy < _kOffsetThreshold ||
|
||||||
@@ -1241,29 +1241,30 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_isPositionAllowed(event.localPosition)) {
|
final controlsUnlock = !plPlayerController.controlsLock.value;
|
||||||
final controlsUnlock = !plPlayerController.controlsLock.value;
|
if (PlatformUtils.isMobile) {
|
||||||
if (PlatformUtils.isMobile) {
|
_tapGestureRecognizer.addPointer(event);
|
||||||
_tapGestureRecognizer.addPointer(event);
|
if (controlsUnlock) {
|
||||||
if (controlsUnlock) {
|
final flag = _isPositionAllowed(event.localPosition);
|
||||||
if (!plPlayerController.isLive) {
|
if (!plPlayerController.isLive) {
|
||||||
_doubleTapGestureRecognizer.addPointer(event);
|
|
||||||
longPressRecognizer.addPointer(event);
|
|
||||||
}
|
|
||||||
_scaleGestureRecognizer.addPointer(event);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (controlsUnlock) {
|
|
||||||
if (!plPlayerController.isLive) {
|
|
||||||
_tapGestureRecognizer.addPointer(event);
|
|
||||||
}
|
|
||||||
_doubleTapGestureRecognizer.addPointer(event);
|
_doubleTapGestureRecognizer.addPointer(event);
|
||||||
if (!plPlayerController.isLive) {
|
if (flag) {
|
||||||
longPressRecognizer.addPointer(event);
|
longPressRecognizer.addPointer(event);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
_scaleGestureRecognizer.addPointer(event);
|
_scaleGestureRecognizer.addPointer(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (controlsUnlock) {
|
||||||
|
if (plPlayerController.isLive) {
|
||||||
|
_doubleTapGestureRecognizer.addPointer(event);
|
||||||
|
} else {
|
||||||
|
_tapGestureRecognizer.addPointer(event);
|
||||||
|
_doubleTapGestureRecognizer.addPointer(event);
|
||||||
|
longPressRecognizer.addPointer(event);
|
||||||
|
}
|
||||||
|
_scaleGestureRecognizer.addPointer(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user