fix: video page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-27 16:01:34 +08:00
parent db8d3bab51
commit e405395347
7 changed files with 66 additions and 34 deletions

View File

@@ -554,6 +554,8 @@ class VideoDetailController extends GetxController
},
options: _options,
);
segmentList.clear();
_segmentProgressList = null;
_handleSBData(result);
}

View File

@@ -567,6 +567,9 @@ class VideoIntroController extends GetxController
this.bvid = bvid;
lastPlayCid.value = cid;
queryVideoIntro();
if (isShowOnlineTotal) {
queryOnlineTotal();
}
}
void startTimer() {
@@ -588,15 +591,15 @@ class VideoIntroController extends GetxController
// 查看同时在看人数
Future queryOnlineTotal() async {
// var result = await VideoHttp.onlineTotal(
// aid: IdUtils.bv2av(bvid),
// bvid: bvid,
// cid: lastPlayCid.value,
// );
dynamic result = await GrpcRepo.playerOnline(
dynamic result = await VideoHttp.onlineTotal(
aid: IdUtils.bv2av(bvid),
bvid: bvid,
cid: lastPlayCid.value,
);
// dynamic result = await GrpcRepo.playerOnline(
// aid: IdUtils.bv2av(bvid),
// cid: lastPlayCid.value,
// );
if (result['status']) {
total.value = result['data'];
}

View File

@@ -158,7 +158,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
late final _coinKey = GlobalKey<ActionItemState>();
late final _favKey = GlobalKey<ActionItemState>();
late final _expandableCtr = ExpandableController(initialExpanded: false);
final _expandableCtr = ExpandableController(initialExpanded: false);
@override
void initState() {

View File

@@ -501,6 +501,11 @@ class _VideoDetailPageState extends State<VideoDetailPage>
Orientation.portrait),
onPopInvokedWithResult:
(bool didPop, Object? result) {
if (plPlayerController?.controlsLock.value ==
true) {
plPlayerController?.onLockControl(false);
return;
}
if (isFullScreen) {
plPlayerController!
.triggerFullScreen(status: false);
@@ -562,6 +567,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: PopScope(
canPop: !isFullScreen,
onPopInvokedWithResult: (bool didPop, Object? result) {
if (plPlayerController?.controlsLock.value == true) {
plPlayerController?.onLockControl(false);
return;
}
if (isFullScreen) {
plPlayerController!.triggerFullScreen(status: false);
}
@@ -614,6 +623,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: PopScope(
canPop: !isFullScreen,
onPopInvokedWithResult: (bool didPop, Object? result) {
if (plPlayerController?.controlsLock.value == true) {
plPlayerController?.onLockControl(false);
return;
}
if (isFullScreen) {
plPlayerController!.triggerFullScreen(status: false);
}
@@ -668,6 +681,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: PopScope(
canPop: !isFullScreen,
onPopInvokedWithResult: (bool didPop, Object? result) {
if (plPlayerController?.controlsLock.value == true) {
plPlayerController?.onLockControl(false);
return;
}
if (isFullScreen) {
plPlayerController!.triggerFullScreen(status: false);
}
@@ -745,6 +762,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: PopScope(
canPop: !isFullScreen,
onPopInvokedWithResult: (bool didPop, Object? result) {
if (plPlayerController?.controlsLock.value == true) {
plPlayerController?.onLockControl(false);
return;
}
if (isFullScreen) {
plPlayerController!.triggerFullScreen(status: false);
}

View File

@@ -1437,36 +1437,40 @@ class _HeaderControlState extends State<HeaderControl> {
constraints: BoxConstraints(
maxWidth: boxConstraints.maxWidth / 2 - 60,
maxHeight: 25),
child: Marquee(
text: videoIntroController.videoDetail.value.title!,
style: const TextStyle(
color: Colors.white,
fontSize: 16,
child: Obx(
() => Marquee(
text: videoIntroController.videoDetail.value.title!,
style: const TextStyle(
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)
Text(
'${videoIntroController.total.value}人正在看',
style: const TextStyle(
color: Colors.white,
fontSize: 11,
Obx(
() => Text(
'${videoIntroController.total.value}人正在看',
style: const TextStyle(
color: Colors.white,
fontSize: 11,
),
),
)
),
],
),
const Spacer(),