mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
mod: view point
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -43,15 +43,16 @@ class SegmentProgressBar extends CustomPainter {
|
|||||||
double fontSize = 10;
|
double fontSize = 10;
|
||||||
|
|
||||||
_defHeight ??= (TextPainter(
|
_defHeight ??= (TextPainter(
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
text: segmentColors[i].title,
|
text: segmentColors[i].title,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: fontSize,
|
fontSize: fontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
)..layout())
|
)..layout())
|
||||||
.height;
|
.height +
|
||||||
|
2;
|
||||||
|
|
||||||
TextPainter getTextPainter() => TextPainter(
|
TextPainter getTextPainter() => TextPainter(
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
|
|||||||
@@ -1166,7 +1166,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
buildDmChart(context, plPlayerController),
|
buildDmChart(context, plPlayerController),
|
||||||
if (plPlayerController.viewPointList.isNotEmpty &&
|
if (plPlayerController.viewPointList.isNotEmpty &&
|
||||||
plPlayerController.showVP.value)
|
plPlayerController.showVP.value)
|
||||||
buildViewPointWidget(plPlayerController),
|
buildViewPointWidget(plPlayerController, 4.25),
|
||||||
ProgressBar(
|
ProgressBar(
|
||||||
progress: Duration(seconds: value),
|
progress: Duration(seconds: value),
|
||||||
buffered: Duration(seconds: buffer),
|
buffered: Duration(seconds: buffer),
|
||||||
@@ -1681,13 +1681,15 @@ Widget buildSeekPreviewWidget(PlPlayerController plPlayerController) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildViewPointWidget(PlPlayerController plPlayerController) {
|
Widget buildViewPointWidget(
|
||||||
|
PlPlayerController plPlayerController, double offset) {
|
||||||
return LayoutBuilder(
|
return LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
return SizedBox(
|
return Container(
|
||||||
height: 20,
|
height: 16,
|
||||||
|
margin: EdgeInsets.only(bottom: offset),
|
||||||
child: Listener(
|
child: Listener(
|
||||||
behavior: HitTestBehavior.translucent,
|
behavior: HitTestBehavior.opaque,
|
||||||
onPointerDown: (event) {
|
onPointerDown: (event) {
|
||||||
try {
|
try {
|
||||||
double seg = event.localPosition.dx / constraints.maxWidth;
|
double seg = event.localPosition.dx / constraints.maxWidth;
|
||||||
|
|||||||
@@ -62,10 +62,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
buildDmChart(context, controller!, 4.5),
|
buildDmChart(context, controller!, 4.5),
|
||||||
if (controller?.viewPointList.isNotEmpty == true &&
|
if (controller?.viewPointList.isNotEmpty == true &&
|
||||||
controller?.showVP.value == true)
|
controller?.showVP.value == true)
|
||||||
Padding(
|
buildViewPointWidget(controller!, 8.75),
|
||||||
padding: const EdgeInsets.only(bottom: 5.25),
|
|
||||||
child: buildViewPointWidget(controller!),
|
|
||||||
),
|
|
||||||
ProgressBar(
|
ProgressBar(
|
||||||
progress: Duration(seconds: value),
|
progress: Duration(seconds: value),
|
||||||
buffered: Duration(seconds: buffer),
|
buffered: Duration(seconds: buffer),
|
||||||
|
|||||||
Reference in New Issue
Block a user