mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: post segments
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -61,20 +61,21 @@ class VideoCardHMemberVideo extends StatelessWidget {
|
|||||||
Hero(
|
Hero(
|
||||||
tag: heroTag,
|
tag: heroTag,
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
src:
|
src: videoItem.cover,
|
||||||
videoItem.season?['cover'] ?? videoItem.cover,
|
// videoItem.season?['cover'] ?? videoItem.cover,
|
||||||
width: maxWidth,
|
width: maxWidth,
|
||||||
height: maxHeight,
|
height: maxHeight,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (videoItem.season != null)
|
// if (videoItem.season != null)
|
||||||
PBadge(
|
// PBadge(
|
||||||
text: '合集: ${videoItem.season?['count']}',
|
// text: '合集: ${videoItem.season?['count']}',
|
||||||
right: 6.0,
|
// right: 6.0,
|
||||||
bottom: 6.0,
|
// bottom: 6.0,
|
||||||
type: 'gray',
|
// type: 'gray',
|
||||||
)
|
// )
|
||||||
else if (videoItem.duration != null)
|
// else
|
||||||
|
if (videoItem.duration != null)
|
||||||
PBadge(
|
PBadge(
|
||||||
text: Utils.timeFormat(videoItem.duration),
|
text: Utils.timeFormat(videoItem.duration),
|
||||||
right: 6.0,
|
right: 6.0,
|
||||||
@@ -126,7 +127,8 @@ class VideoContent extends StatelessWidget {
|
|||||||
...[
|
...[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
videoItem.season?['title'] ?? videoItem.title ?? '',
|
// videoItem.season?['title'] ?? videoItem.title ?? '',
|
||||||
|
videoItem.title ?? '',
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
@@ -157,13 +159,15 @@ class VideoContent extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
StatView(
|
StatView(
|
||||||
theme: 'gray',
|
theme: 'gray',
|
||||||
view: videoItem.season?['view_content'] ??
|
// view: videoItem.season?['view_content'] ??
|
||||||
videoItem.viewContent,
|
// videoItem.viewContent,
|
||||||
|
view: videoItem.viewContent,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
StatDanMu(
|
StatDanMu(
|
||||||
theme: 'gray',
|
theme: 'gray',
|
||||||
danmu: videoItem.season?['danmaku'] ?? videoItem.danmaku,
|
// danmu: videoItem.season?['danmaku'] ?? videoItem.danmaku,
|
||||||
|
danmu: videoItem.danmaku,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -2,12 +2,14 @@ import 'dart:async';
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'package:PiliPalaX/common/constants.dart';
|
import 'package:PiliPalaX/common/constants.dart';
|
||||||
|
import 'package:PiliPalaX/common/widgets/article_content.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/icon_button.dart';
|
import 'package:PiliPalaX/common/widgets/icon_button.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/loading_widget.dart';
|
import 'package:PiliPalaX/common/widgets/loading_widget.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/pair.dart';
|
import 'package:PiliPalaX/common/widgets/pair.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/segment_progress_bar.dart';
|
import 'package:PiliPalaX/common/widgets/segment_progress_bar.dart';
|
||||||
import 'package:PiliPalaX/http/danmaku.dart';
|
import 'package:PiliPalaX/http/danmaku.dart';
|
||||||
import 'package:PiliPalaX/http/init.dart';
|
import 'package:PiliPalaX/http/init.dart';
|
||||||
|
import 'package:PiliPalaX/utils/extension.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:floating/floating.dart';
|
import 'package:floating/floating.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -1025,7 +1027,10 @@ class VideoDetailController extends GetxController
|
|||||||
if (list!.isEmpty) {
|
if (list!.isEmpty) {
|
||||||
list!.add(
|
list!.add(
|
||||||
PostSegmentModel(
|
PostSegmentModel(
|
||||||
segment: Pair(first: 0, second: 0),
|
segment: Pair(
|
||||||
|
first: plPlayerController.positionSeconds.value,
|
||||||
|
second: plPlayerController.positionSeconds.value,
|
||||||
|
),
|
||||||
category: SegmentType.sponsor,
|
category: SegmentType.sponsor,
|
||||||
actionType: ActionType.skip,
|
actionType: ActionType.skip,
|
||||||
),
|
),
|
||||||
@@ -1178,7 +1183,10 @@ class VideoDetailController extends GetxController
|
|||||||
list?.insert(
|
list?.insert(
|
||||||
0,
|
0,
|
||||||
PostSegmentModel(
|
PostSegmentModel(
|
||||||
segment: Pair(first: 0, second: 0),
|
segment: Pair(
|
||||||
|
first: plPlayerController.positionSeconds.value,
|
||||||
|
second: plPlayerController.positionSeconds.value,
|
||||||
|
),
|
||||||
category: SegmentType.sponsor,
|
category: SegmentType.sponsor,
|
||||||
actionType: ActionType.skip,
|
actionType: ActionType.skip,
|
||||||
),
|
),
|
||||||
@@ -1222,11 +1230,8 @@ class VideoDetailController extends GetxController
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
if (list![index].category !=
|
if (list![index].actionType !=
|
||||||
SegmentType
|
ActionType.full) ...[
|
||||||
.exclusive_access &&
|
|
||||||
list![index].actionType !=
|
|
||||||
ActionType.full) ...[
|
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
...segmentWidget(
|
...segmentWidget(
|
||||||
@@ -1254,28 +1259,35 @@ class VideoDetailController extends GetxController
|
|||||||
list![index].category,
|
list![index].category,
|
||||||
onSelected: (item) async {
|
onSelected: (item) async {
|
||||||
list![index].category = item;
|
list![index].category = item;
|
||||||
list![index].actionType =
|
List<ActionType>
|
||||||
|
constraintList =
|
||||||
_segmentType2ActionType(
|
_segmentType2ActionType(
|
||||||
item)
|
item);
|
||||||
.first;
|
if (constraintList
|
||||||
|
.contains(list![index]
|
||||||
|
.actionType)
|
||||||
|
.not) {
|
||||||
|
list![index].actionType =
|
||||||
|
constraintList.first;
|
||||||
|
}
|
||||||
switch (item) {
|
switch (item) {
|
||||||
case SegmentType
|
case SegmentType
|
||||||
.poi_highlight:
|
.poi_highlight:
|
||||||
list![index]
|
updateSegment(
|
||||||
.segment
|
isFirst: false,
|
||||||
.second =
|
index: index,
|
||||||
list![index]
|
value: list![index]
|
||||||
.segment
|
.segment
|
||||||
.first;
|
.first,
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case SegmentType
|
case SegmentType
|
||||||
.exclusive_access:
|
.exclusive_access:
|
||||||
list![index]
|
updateSegment(
|
||||||
.segment
|
isFirst: true,
|
||||||
.first = 0;
|
index: index,
|
||||||
list![index]
|
value: 0,
|
||||||
.segment
|
);
|
||||||
.second = 0;
|
|
||||||
break;
|
break;
|
||||||
case _:
|
case _:
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user