mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: video page
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -90,7 +90,9 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
imageBuilder: imageBuilder,
|
imageBuilder: imageBuilder,
|
||||||
errorListener: (value) {
|
errorListener: (value) {
|
||||||
thumbnail = false;
|
thumbnail = false;
|
||||||
(context as Element).markNeedsBuild();
|
if (context.mounted) {
|
||||||
|
(context as Element).markNeedsBuild();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -805,7 +805,7 @@ class VideoHttp {
|
|||||||
'cid': cid,
|
'cid': cid,
|
||||||
});
|
});
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {'status': true, 'data': res.data['data']};
|
return {'status': true, 'data': res.data['data']['total']};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'data': null, 'msg': res.data['message']};
|
return {'status': false, 'data': null, 'msg': res.data['message']};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -554,6 +554,8 @@ class VideoDetailController extends GetxController
|
|||||||
},
|
},
|
||||||
options: _options,
|
options: _options,
|
||||||
);
|
);
|
||||||
|
segmentList.clear();
|
||||||
|
_segmentProgressList = null;
|
||||||
_handleSBData(result);
|
_handleSBData(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -567,6 +567,9 @@ class VideoIntroController extends GetxController
|
|||||||
this.bvid = bvid;
|
this.bvid = bvid;
|
||||||
lastPlayCid.value = cid;
|
lastPlayCid.value = cid;
|
||||||
queryVideoIntro();
|
queryVideoIntro();
|
||||||
|
if (isShowOnlineTotal) {
|
||||||
|
queryOnlineTotal();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void startTimer() {
|
void startTimer() {
|
||||||
@@ -588,15 +591,15 @@ class VideoIntroController extends GetxController
|
|||||||
|
|
||||||
// 查看同时在看人数
|
// 查看同时在看人数
|
||||||
Future queryOnlineTotal() async {
|
Future queryOnlineTotal() async {
|
||||||
// var result = await VideoHttp.onlineTotal(
|
dynamic result = await VideoHttp.onlineTotal(
|
||||||
// aid: IdUtils.bv2av(bvid),
|
|
||||||
// bvid: bvid,
|
|
||||||
// cid: lastPlayCid.value,
|
|
||||||
// );
|
|
||||||
dynamic result = await GrpcRepo.playerOnline(
|
|
||||||
aid: IdUtils.bv2av(bvid),
|
aid: IdUtils.bv2av(bvid),
|
||||||
|
bvid: bvid,
|
||||||
cid: lastPlayCid.value,
|
cid: lastPlayCid.value,
|
||||||
);
|
);
|
||||||
|
// dynamic result = await GrpcRepo.playerOnline(
|
||||||
|
// aid: IdUtils.bv2av(bvid),
|
||||||
|
// cid: lastPlayCid.value,
|
||||||
|
// );
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
total.value = result['data'];
|
total.value = result['data'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
|
|
||||||
late final _coinKey = GlobalKey<ActionItemState>();
|
late final _coinKey = GlobalKey<ActionItemState>();
|
||||||
late final _favKey = GlobalKey<ActionItemState>();
|
late final _favKey = GlobalKey<ActionItemState>();
|
||||||
late final _expandableCtr = ExpandableController(initialExpanded: false);
|
final _expandableCtr = ExpandableController(initialExpanded: false);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
|||||||
@@ -501,6 +501,11 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
Orientation.portrait),
|
Orientation.portrait),
|
||||||
onPopInvokedWithResult:
|
onPopInvokedWithResult:
|
||||||
(bool didPop, Object? result) {
|
(bool didPop, Object? result) {
|
||||||
|
if (plPlayerController?.controlsLock.value ==
|
||||||
|
true) {
|
||||||
|
plPlayerController?.onLockControl(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (isFullScreen) {
|
if (isFullScreen) {
|
||||||
plPlayerController!
|
plPlayerController!
|
||||||
.triggerFullScreen(status: false);
|
.triggerFullScreen(status: false);
|
||||||
@@ -562,6 +567,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
child: PopScope(
|
child: PopScope(
|
||||||
canPop: !isFullScreen,
|
canPop: !isFullScreen,
|
||||||
onPopInvokedWithResult: (bool didPop, Object? result) {
|
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||||
|
if (plPlayerController?.controlsLock.value == true) {
|
||||||
|
plPlayerController?.onLockControl(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (isFullScreen) {
|
if (isFullScreen) {
|
||||||
plPlayerController!.triggerFullScreen(status: false);
|
plPlayerController!.triggerFullScreen(status: false);
|
||||||
}
|
}
|
||||||
@@ -614,6 +623,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
child: PopScope(
|
child: PopScope(
|
||||||
canPop: !isFullScreen,
|
canPop: !isFullScreen,
|
||||||
onPopInvokedWithResult: (bool didPop, Object? result) {
|
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||||
|
if (plPlayerController?.controlsLock.value == true) {
|
||||||
|
plPlayerController?.onLockControl(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (isFullScreen) {
|
if (isFullScreen) {
|
||||||
plPlayerController!.triggerFullScreen(status: false);
|
plPlayerController!.triggerFullScreen(status: false);
|
||||||
}
|
}
|
||||||
@@ -668,6 +681,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
child: PopScope(
|
child: PopScope(
|
||||||
canPop: !isFullScreen,
|
canPop: !isFullScreen,
|
||||||
onPopInvokedWithResult: (bool didPop, Object? result) {
|
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||||
|
if (plPlayerController?.controlsLock.value == true) {
|
||||||
|
plPlayerController?.onLockControl(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (isFullScreen) {
|
if (isFullScreen) {
|
||||||
plPlayerController!.triggerFullScreen(status: false);
|
plPlayerController!.triggerFullScreen(status: false);
|
||||||
}
|
}
|
||||||
@@ -745,6 +762,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
child: PopScope(
|
child: PopScope(
|
||||||
canPop: !isFullScreen,
|
canPop: !isFullScreen,
|
||||||
onPopInvokedWithResult: (bool didPop, Object? result) {
|
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||||
|
if (plPlayerController?.controlsLock.value == true) {
|
||||||
|
plPlayerController?.onLockControl(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (isFullScreen) {
|
if (isFullScreen) {
|
||||||
plPlayerController!.triggerFullScreen(status: false);
|
plPlayerController!.triggerFullScreen(status: false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1437,36 +1437,40 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxWidth: boxConstraints.maxWidth / 2 - 60,
|
maxWidth: boxConstraints.maxWidth / 2 - 60,
|
||||||
maxHeight: 25),
|
maxHeight: 25),
|
||||||
child: Marquee(
|
child: Obx(
|
||||||
text: videoIntroController.videoDetail.value.title!,
|
() => Marquee(
|
||||||
style: const TextStyle(
|
text: videoIntroController.videoDetail.value.title!,
|
||||||
color: Colors.white,
|
style: const TextStyle(
|
||||||
fontSize: 16,
|
color: Colors.white,
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
scrollAxis: Axis.horizontal,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
blankSpace: 200,
|
||||||
|
velocity: 40,
|
||||||
|
startAfter: const Duration(seconds: 1),
|
||||||
|
showFadingOnlyWhenScrolling: true,
|
||||||
|
fadingEdgeStartFraction: 0,
|
||||||
|
fadingEdgeEndFraction: 0.1,
|
||||||
|
numberOfRounds: 1,
|
||||||
|
startPadding: 0,
|
||||||
|
accelerationDuration: const Duration(seconds: 1),
|
||||||
|
accelerationCurve: Curves.linear,
|
||||||
|
decelerationDuration: const Duration(milliseconds: 500),
|
||||||
|
decelerationCurve: Curves.easeOut,
|
||||||
),
|
),
|
||||||
scrollAxis: Axis.horizontal,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
blankSpace: 200,
|
|
||||||
velocity: 40,
|
|
||||||
startAfter: const Duration(seconds: 1),
|
|
||||||
showFadingOnlyWhenScrolling: true,
|
|
||||||
fadingEdgeStartFraction: 0,
|
|
||||||
fadingEdgeEndFraction: 0.1,
|
|
||||||
numberOfRounds: 1,
|
|
||||||
startPadding: 0,
|
|
||||||
accelerationDuration: const Duration(seconds: 1),
|
|
||||||
accelerationCurve: Curves.linear,
|
|
||||||
decelerationDuration: const Duration(milliseconds: 500),
|
|
||||||
decelerationCurve: Curves.easeOut,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (videoIntroController.isShowOnlineTotal)
|
if (videoIntroController.isShowOnlineTotal)
|
||||||
Text(
|
Obx(
|
||||||
'${videoIntroController.total.value}人正在看',
|
() => Text(
|
||||||
style: const TextStyle(
|
'${videoIntroController.total.value}人正在看',
|
||||||
color: Colors.white,
|
style: const TextStyle(
|
||||||
fontSize: 11,
|
color: Colors.white,
|
||||||
|
fontSize: 11,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
|
|||||||
Reference in New Issue
Block a user