mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix:播放异常黑屏等
This commit is contained in:
@@ -23,8 +23,8 @@ class _EmotePanelState extends State<EmotePanel>
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_futureBuilderFuture = _emotePanelController.getEmote();
|
||||
super.initState();
|
||||
_futureBuilderFuture = _emotePanelController.getEmote();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -24,8 +24,8 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_futureBuilderFuture = _historyController.queryHistoryList();
|
||||
super.initState();
|
||||
_futureBuilderFuture = _historyController.queryHistoryList();
|
||||
scrollController = _historyController.scrollController;
|
||||
scrollController.addListener(
|
||||
() {
|
||||
|
||||
@@ -94,7 +94,8 @@ class _RcmdPageState extends State<RcmdPage>
|
||||
sliver: FutureBuilder(
|
||||
future: _futureBuilderFuture,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.data != null) {
|
||||
Map data = snapshot.data as Map;
|
||||
if (data['status']) {
|
||||
return Obx(
|
||||
@@ -111,7 +112,7 @@ class _RcmdPageState extends State<RcmdPage>
|
||||
);
|
||||
} else {
|
||||
return HttpError(
|
||||
errMsg: data['msg'],
|
||||
errMsg: data == null ? "" : data['msg'],
|
||||
fn: () {
|
||||
setState(() {
|
||||
_rcmdController.isLoadingMore = true;
|
||||
|
||||
@@ -268,7 +268,9 @@ class VideoDetailController extends GetxController
|
||||
// 硬解
|
||||
enableHA: enableHA.value,
|
||||
seekTo: seekToTime ?? defaultST,
|
||||
duration: duration ?? Duration(milliseconds: data.timeLength ?? 0),
|
||||
duration: duration ?? data.timeLength == null
|
||||
? null
|
||||
: Duration(milliseconds: data.timeLength!),
|
||||
// 宽>高 水平 否则 垂直
|
||||
direction: firstVideo.width != null && firstVideo.height != null
|
||||
? ((firstVideo.width! - firstVideo.height!) > 0
|
||||
|
||||
@@ -39,11 +39,11 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_videoReplyReplyController = Get.put(
|
||||
VideoReplyReplyController(
|
||||
widget.oid, widget.rpid.toString(), widget.replyType!),
|
||||
tag: widget.rpid.toString());
|
||||
super.initState();
|
||||
|
||||
// 上拉加载更多
|
||||
scrollController = _videoReplyReplyController.scrollController;
|
||||
|
||||
@@ -293,10 +293,20 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
!videoDetailController.isShowCover.value;
|
||||
videoIntroController.isPaused = false;
|
||||
if (autoplay) {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
plPlayerController?.seekTo(videoDetailController.defaultST);
|
||||
plPlayerController?.play();
|
||||
// await Future.delayed(const Duration(milliseconds: 300));
|
||||
if (plPlayerController?.buffered.value == Duration.zero) {
|
||||
plPlayerController?.buffered.listen((p0) {
|
||||
if (p0 > Duration.zero) {
|
||||
plPlayerController?.seekTo(videoDetailController.defaultST);
|
||||
plPlayerController?.play();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
plPlayerController?.seekTo(videoDetailController.defaultST);
|
||||
plPlayerController?.play();
|
||||
}
|
||||
}
|
||||
AutoOrientation.fullAutoMode();
|
||||
plPlayerController?.addStatusLister(playerListener);
|
||||
if (plPlayerController != null) {
|
||||
listenFullScreenStatus();
|
||||
|
||||
@@ -1063,19 +1063,16 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
size: 15,
|
||||
color: Colors.white,
|
||||
),
|
||||
onPressed: () => <Set<void>>{
|
||||
if (widget.controller!.isFullScreen.value)
|
||||
<void>{widget.controller!.triggerFullScreen(status: false)}
|
||||
else
|
||||
<void>{
|
||||
if (MediaQuery.of(context).orientation ==
|
||||
Orientation.landscape &&
|
||||
!horizontalScreen)
|
||||
{
|
||||
verticalScreenForTwoSeconds(),
|
||||
},
|
||||
Get.back()
|
||||
}
|
||||
onPressed: () {
|
||||
if (widget.controller!.isFullScreen.value) {
|
||||
widget.controller!.triggerFullScreen(status: false);
|
||||
} else if (MediaQuery.of(context).orientation ==
|
||||
Orientation.landscape &&
|
||||
!horizontalScreen) {
|
||||
verticalScreenForTwoSeconds();
|
||||
} else {
|
||||
Get.back();
|
||||
}
|
||||
},
|
||||
)),
|
||||
if ((videoIntroController.videoDetail.value.title != null) &&
|
||||
|
||||
Reference in New Issue
Block a user