mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -110,6 +110,13 @@ class AudioController extends GetxController
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _updateCurrItem(DetailItem item) {
|
||||||
|
audioItem.value = item;
|
||||||
|
hasLike.value = item.stat.hasLike_7;
|
||||||
|
coinNum.value = item.stat.hasCoin_8 ? 2 : 0;
|
||||||
|
hasFav.value = item.stat.hasFav;
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> _queryPlayList({
|
Future<void> _queryPlayList({
|
||||||
bool isInit = false,
|
bool isInit = false,
|
||||||
bool isLoadPrev = false,
|
bool isLoadPrev = false,
|
||||||
@@ -136,11 +143,7 @@ class AudioController extends GetxController
|
|||||||
final index = data.list.indexWhere((e) => e.item.oid == oid);
|
final index = data.list.indexWhere((e) => e.item.oid == oid);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
this.index = index;
|
this.index = index;
|
||||||
final item = data.list[index];
|
_updateCurrItem(data.list[index]);
|
||||||
audioItem.value = item;
|
|
||||||
hasLike.value = item.stat.hasLike_7;
|
|
||||||
coinNum.value = item.stat.hasCoin_8 ? 2 : 0;
|
|
||||||
hasFav.value = item.stat.hasFav;
|
|
||||||
playlist = data.list;
|
playlist = data.list;
|
||||||
}
|
}
|
||||||
} else if (isLoadPrev) {
|
} else if (isLoadPrev) {
|
||||||
@@ -356,6 +359,7 @@ class AudioController extends GetxController
|
|||||||
hasLike.value = true;
|
hasLike.value = true;
|
||||||
}
|
}
|
||||||
coinNum.value += coin;
|
coinNum.value += coin;
|
||||||
|
GlobalData().afterCoin(coin);
|
||||||
} else {
|
} else {
|
||||||
res.toast();
|
res.toast();
|
||||||
}
|
}
|
||||||
@@ -540,7 +544,7 @@ class AudioController extends GetxController
|
|||||||
itemType = item.itemType;
|
itemType = item.itemType;
|
||||||
_queryPlayUrl().then((res) {
|
_queryPlayUrl().then((res) {
|
||||||
if (res) {
|
if (res) {
|
||||||
this.audioItem.value = audioItem;
|
_updateCurrItem(audioItem);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -456,6 +456,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
ModalRoute.of(context)! as PageRoute,
|
ModalRoute.of(context)! as PageRoute,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
padding = MediaQuery.viewPaddingOf(context);
|
||||||
|
|
||||||
final size = MediaQuery.sizeOf(context);
|
final size = MediaQuery.sizeOf(context);
|
||||||
maxWidth = size.width;
|
maxWidth = size.width;
|
||||||
maxHeight = size.height;
|
maxHeight = size.height;
|
||||||
@@ -548,7 +550,11 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
return Obx(
|
return Obx(
|
||||||
() {
|
() {
|
||||||
final isFullScreen = this.isFullScreen;
|
final isFullScreen = this.isFullScreen;
|
||||||
return Scaffold(
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: isFullScreen && isPortrait ? padding.top : 0,
|
||||||
|
),
|
||||||
|
child: Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
appBar: isFullScreen
|
appBar: isFullScreen
|
||||||
? null
|
? null
|
||||||
@@ -604,7 +610,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
onlyOneScrollInBody: true,
|
onlyOneScrollInBody: true,
|
||||||
pinnedHeaderSliverHeightBuilder: () {
|
pinnedHeaderSliverHeightBuilder: () {
|
||||||
double pinnedHeight = this.isFullScreen || !isPortrait
|
double pinnedHeight = this.isFullScreen || !isPortrait
|
||||||
? maxHeight
|
? maxHeight - (isPortrait ? padding.top : 0)
|
||||||
: videoDetailController.isExpanding ||
|
: videoDetailController.isExpanding ||
|
||||||
videoDetailController.isCollapsing
|
videoDetailController.isCollapsing
|
||||||
? animHeight
|
? animHeight
|
||||||
@@ -631,8 +637,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
},
|
},
|
||||||
headerSliverBuilder: (context, innerBoxIsScrolled) {
|
headerSliverBuilder: (context, innerBoxIsScrolled) {
|
||||||
final isFullScreen = this.isFullScreen;
|
final isFullScreen = this.isFullScreen;
|
||||||
final height = !isPortrait || isFullScreen
|
final height = isFullScreen || !isPortrait
|
||||||
? maxHeight
|
? maxHeight - (isPortrait ? padding.top : 0)
|
||||||
: videoDetailController.isExpanding ||
|
: videoDetailController.isExpanding ||
|
||||||
videoDetailController.isCollapsing
|
videoDetailController.isCollapsing
|
||||||
? animHeight
|
? animHeight
|
||||||
@@ -644,12 +650,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
primary: false,
|
primary: false,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
pinned: true,
|
pinned: true,
|
||||||
expandedHeight: isFullScreen || !isPortrait
|
expandedHeight: height,
|
||||||
? maxHeight
|
|
||||||
: videoDetailController.isExpanding ||
|
|
||||||
videoDetailController.isCollapsing
|
|
||||||
? animHeight
|
|
||||||
: videoDetailController.videoHeight,
|
|
||||||
flexibleSpace: Stack(
|
flexibleSpace: Stack(
|
||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
@@ -735,8 +736,9 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
? '重新'
|
? '重新'
|
||||||
: '继续'}播放',
|
: '继续'}播放',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color:
|
color: themeData
|
||||||
themeData.colorScheme.primary,
|
.colorScheme
|
||||||
|
.primary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -781,8 +783,10 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return videoDetailController.scrollRatio.value == 0 ||
|
return videoDetailController.scrollRatio.value ==
|
||||||
videoDetailController.scrollCtr.offset == 0 ||
|
0 ||
|
||||||
|
videoDetailController.scrollCtr.offset ==
|
||||||
|
0 ||
|
||||||
!isPortrait
|
!isPortrait
|
||||||
? const SizedBox.shrink()
|
? const SizedBox.shrink()
|
||||||
: Positioned.fill(
|
: Positioned.fill(
|
||||||
@@ -809,7 +813,9 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
videoDetailController.queryVideoUrl();
|
videoDetailController.queryVideoUrl();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
videoDetailController.scrollRatio.value =
|
videoDetailController
|
||||||
|
.scrollRatio
|
||||||
|
.value =
|
||||||
0;
|
0;
|
||||||
if (plPlayerController == null ||
|
if (plPlayerController == null ||
|
||||||
videoDetailController.playedTime ==
|
videoDetailController.playedTime ==
|
||||||
@@ -870,6 +876,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -878,7 +885,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
Widget get childWhenDisabledLandscape => Obx(
|
Widget get childWhenDisabledLandscape => Obx(
|
||||||
() {
|
() {
|
||||||
final isFullScreen = this.isFullScreen;
|
final isFullScreen = this.isFullScreen;
|
||||||
final padding = MediaQuery.viewPaddingOf(context);
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
appBar: isFullScreen
|
appBar: isFullScreen
|
||||||
@@ -1052,7 +1058,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
|
|
||||||
Widget get childWhenDisabledAlmostSquare => Obx(() {
|
Widget get childWhenDisabledAlmostSquare => Obx(() {
|
||||||
final isFullScreen = this.isFullScreen;
|
final isFullScreen = this.isFullScreen;
|
||||||
final padding = MediaQuery.viewPaddingOf(context);
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
appBar: isFullScreen
|
appBar: isFullScreen
|
||||||
@@ -1368,6 +1373,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
late bool isPortrait;
|
late bool isPortrait;
|
||||||
late double maxWidth;
|
late double maxWidth;
|
||||||
late double maxHeight;
|
late double maxHeight;
|
||||||
|
late EdgeInsets padding;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -1730,7 +1736,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
bool needCtr = true,
|
bool needCtr = true,
|
||||||
bool isNested = false,
|
bool isNested = false,
|
||||||
}) {
|
}) {
|
||||||
final bottom = MediaQuery.viewPaddingOf(context).bottom;
|
|
||||||
Widget introPanel() => KeepAliveWrapper(
|
Widget introPanel() => KeepAliveWrapper(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
final child = CustomScrollView(
|
final child = CustomScrollView(
|
||||||
@@ -1786,7 +1791,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
(videoDetailController.isPlayAll && !isPortrait
|
(videoDetailController.isPlayAll && !isPortrait
|
||||||
? 80
|
? 80
|
||||||
: StyleString.safeSpace) +
|
: StyleString.safeSpace) +
|
||||||
bottom,
|
padding.bottom,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -1808,7 +1813,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
Positioned(
|
Positioned(
|
||||||
left: 12,
|
left: 12,
|
||||||
right: 12,
|
right: 12,
|
||||||
bottom: 12 + bottom,
|
bottom: 12 + padding.bottom,
|
||||||
child: Material(
|
child: Material(
|
||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import 'package:PiliPlus/plugin/pl_player/widgets/forward_seek.dart';
|
|||||||
import 'package:PiliPlus/plugin/pl_player/widgets/mpv_convert_webp.dart';
|
import 'package:PiliPlus/plugin/pl_player/widgets/mpv_convert_webp.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/widgets/play_pause_btn.dart';
|
import 'package:PiliPlus/plugin/pl_player/widgets/play_pause_btn.dart';
|
||||||
import 'package:PiliPlus/utils/duration_utils.dart';
|
import 'package:PiliPlus/utils/duration_utils.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/id_utils.dart';
|
import 'package:PiliPlus/utils/id_utils.dart';
|
||||||
import 'package:PiliPlus/utils/image_utils.dart';
|
import 'package:PiliPlus/utils/image_utils.dart';
|
||||||
import 'package:PiliPlus/utils/storage.dart';
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
@@ -793,10 +794,16 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
|
|
||||||
late final transformationController = TransformationController();
|
late final transformationController = TransformationController();
|
||||||
|
|
||||||
late ThemeData theme;
|
late ColorScheme colorScheme;
|
||||||
late double maxWidth;
|
late double maxWidth;
|
||||||
late double maxHeight;
|
late double maxHeight;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didChangeDependencies() {
|
||||||
|
super.didChangeDependencies();
|
||||||
|
colorScheme = ColorScheme.of(context);
|
||||||
|
}
|
||||||
|
|
||||||
void _onInteractionStart(ScaleStartDetails details) {
|
void _onInteractionStart(ScaleStartDetails details) {
|
||||||
if (plPlayerController.controlsLock.value) return;
|
if (plPlayerController.controlsLock.value) return;
|
||||||
// 如果起点太靠上则屏蔽
|
// 如果起点太靠上则屏蔽
|
||||||
@@ -911,12 +918,12 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(6),
|
Radius.circular(6),
|
||||||
),
|
),
|
||||||
color: theme.colorScheme.secondaryContainer,
|
color: colorScheme.secondaryContainer,
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
'松开手指,取消进退',
|
'松开手指,取消进退',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: theme.colorScheme.onSecondaryContainer,
|
color: colorScheme.onSecondaryContainer,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1172,10 +1179,11 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
theme = Theme.of(context);
|
|
||||||
maxWidth = widget.maxWidth;
|
maxWidth = widget.maxWidth;
|
||||||
maxHeight = widget.maxHeight;
|
maxHeight = widget.maxHeight;
|
||||||
final Color primary = theme.colorScheme.primary;
|
final primary = colorScheme.isLight
|
||||||
|
? colorScheme.inversePrimary
|
||||||
|
: colorScheme.primary;
|
||||||
late final thumbGlowColor = primary.withAlpha(80);
|
late final thumbGlowColor = primary.withAlpha(80);
|
||||||
late final bufferedBarColor = primary.withValues(alpha: 0.4);
|
late final bufferedBarColor = primary.withValues(alpha: 0.4);
|
||||||
const TextStyle textStyle = TextStyle(
|
const TextStyle textStyle = TextStyle(
|
||||||
@@ -1508,7 +1516,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
child: FilledButton.tonal(
|
child: FilledButton.tonal(
|
||||||
style: FilledButton.styleFrom(
|
style: FilledButton.styleFrom(
|
||||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
backgroundColor: theme.colorScheme.secondaryContainer
|
backgroundColor: colorScheme.secondaryContainer
|
||||||
.withValues(alpha: 0.8),
|
.withValues(alpha: 0.8),
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
padding: const EdgeInsets.all(15),
|
padding: const EdgeInsets.all(15),
|
||||||
@@ -1660,7 +1668,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
videoDetailController.showDmTreandChart.value)
|
videoDetailController.showDmTreandChart.value)
|
||||||
if (videoDetailController.dmTrend.value?.dataOrNull
|
if (videoDetailController.dmTrend.value?.dataOrNull
|
||||||
case final list?)
|
case final list?)
|
||||||
buildDmChart(theme, list, videoDetailController),
|
buildDmChart(primary, list, videoDetailController),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -2040,12 +2048,11 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget buildDmChart(
|
Widget buildDmChart(
|
||||||
ThemeData theme,
|
Color color,
|
||||||
List<double> dmTrend,
|
List<double> dmTrend,
|
||||||
VideoDetailController videoDetailController, [
|
VideoDetailController videoDetailController, [
|
||||||
double offset = 0,
|
double offset = 0,
|
||||||
]) {
|
]) {
|
||||||
final color = theme.colorScheme.primary;
|
|
||||||
return IgnorePointer(
|
return IgnorePointer(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 12,
|
height: 12,
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ class AppBarAni extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: ViewSafeArea(
|
child: ViewSafeArea(
|
||||||
top: isTop && isFullScreen,
|
|
||||||
left: isFullScreen,
|
left: isFullScreen,
|
||||||
right: isFullScreen,
|
right: isFullScreen,
|
||||||
child: child,
|
child: child,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:PiliPlus/common/widgets/progress_bar/segment_progress_bar.dart';
|
|||||||
import 'package:PiliPlus/pages/video/controller.dart';
|
import 'package:PiliPlus/pages/video/controller.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/view.dart';
|
import 'package:PiliPlus/plugin/pl_player/view.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/feed_back.dart';
|
import 'package:PiliPlus/utils/feed_back.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -29,8 +30,10 @@ class BottomControl extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final colorScheme = ColorScheme.of(context);
|
||||||
Color primary = theme.colorScheme.primary;
|
final primary = colorScheme.isLight
|
||||||
|
? colorScheme.inversePrimary
|
||||||
|
: colorScheme.primary;
|
||||||
final thumbGlowColor = primary.withAlpha(80);
|
final thumbGlowColor = primary.withAlpha(80);
|
||||||
final bufferedBarColor = primary.withValues(alpha: 0.4);
|
final bufferedBarColor = primary.withValues(alpha: 0.4);
|
||||||
//阅读器限制
|
//阅读器限制
|
||||||
@@ -113,6 +116,7 @@ class BottomControl extends StatelessWidget {
|
|||||||
thumbGlowColor: thumbGlowColor,
|
thumbGlowColor: thumbGlowColor,
|
||||||
barHeight: 3.5,
|
barHeight: 3.5,
|
||||||
thumbRadius: 7,
|
thumbRadius: 7,
|
||||||
|
thumbGlowRadius: 25,
|
||||||
onDragStart: onDragStart,
|
onDragStart: onDragStart,
|
||||||
onDragUpdate: (e) => onDragUpdate(e, max),
|
onDragUpdate: (e) => onDragUpdate(e, max),
|
||||||
onSeek: (e) => onSeek(e, max),
|
onSeek: (e) => onSeek(e, max),
|
||||||
@@ -175,7 +179,7 @@ class BottomControl extends StatelessWidget {
|
|||||||
if (videoDetailController.showDmTreandChart.value)
|
if (videoDetailController.showDmTreandChart.value)
|
||||||
if (videoDetailController.dmTrend.value?.dataOrNull
|
if (videoDetailController.dmTrend.value?.dataOrNull
|
||||||
case final list?)
|
case final list?)
|
||||||
buildDmChart(theme, list, videoDetailController, 4.5),
|
buildDmChart(primary, list, videoDetailController, 4.5),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user