feat: 番剧播放
This commit is contained in:
@ -5,6 +5,7 @@ import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/http/constants.dart';
|
||||
import 'package:pilipala/http/video.dart';
|
||||
import 'package:pilipala/models/common/reply_type.dart';
|
||||
import 'package:pilipala/models/common/search_type.dart';
|
||||
import 'package:pilipala/models/video/play/quality.dart';
|
||||
import 'package:pilipala/models/video/play/url.dart';
|
||||
import 'package:pilipala/models/video/reply/item.dart';
|
||||
@ -22,6 +23,9 @@ class VideoDetailController extends GetxController
|
||||
// 视频aid
|
||||
String bvid = Get.parameters['bvid']!;
|
||||
int cid = int.parse(Get.parameters['cid']!);
|
||||
// 视频类型 默认投稿视频
|
||||
SearchType videoType = SearchType.video;
|
||||
|
||||
late PlayUrlModel data;
|
||||
// 当前画质
|
||||
late VideoQuality currentVideoQa;
|
||||
@ -74,6 +78,7 @@ class VideoDetailController extends GetxController
|
||||
bgCover.value = Get.arguments['pic'];
|
||||
}
|
||||
heroTag = Get.arguments['heroTag'];
|
||||
videoType = Get.arguments['videoType'] ?? SearchType.video;
|
||||
}
|
||||
tabCtr = TabController(length: 2, vsync: this);
|
||||
// queryVideoUrl();
|
||||
|
||||
@ -389,4 +389,13 @@ class VideoIntroController extends GetxController {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 修改分P或番剧分集
|
||||
Future changeSeasonOrbangu(bvid, cid) async {
|
||||
var _videoDetailCtr =
|
||||
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
|
||||
_videoDetailCtr.bvid = bvid;
|
||||
_videoDetailCtr.cid = cid;
|
||||
_videoDetailCtr.queryVideoUrl();
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/common/widgets/sliver_header.dart';
|
||||
import 'package:pilipala/models/common/search_type.dart';
|
||||
import 'package:pilipala/pages/bangumi/introduction/index.dart';
|
||||
import 'package:pilipala/pages/video/detail/introduction/widgets/menu_row.dart';
|
||||
import 'package:pilipala/pages/video/detail/reply/index.dart';
|
||||
import 'package:pilipala/pages/video/detail/controller.dart';
|
||||
@ -324,16 +326,25 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
return CustomScrollView(
|
||||
key: const PageStorageKey<String>('简介'),
|
||||
slivers: <Widget>[
|
||||
const VideoIntroPanel(),
|
||||
SliverPersistentHeader(
|
||||
floating: true,
|
||||
pinned: true,
|
||||
delegate: SliverHeaderDelegate(
|
||||
height: 50,
|
||||
child:
|
||||
const MenuRow(loadingStatus: false),
|
||||
if (videoDetailController.videoType ==
|
||||
SearchType.video) ...[
|
||||
const VideoIntroPanel(),
|
||||
] else if (videoDetailController.videoType ==
|
||||
SearchType.media_bangumi) ...[
|
||||
const BangumiIntroPanel()
|
||||
],
|
||||
if (videoDetailController.videoType ==
|
||||
SearchType.video) ...[
|
||||
SliverPersistentHeader(
|
||||
floating: true,
|
||||
pinned: true,
|
||||
delegate: SliverHeaderDelegate(
|
||||
height: 50,
|
||||
child:
|
||||
const MenuRow(loadingStatus: false),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const RelatedVideoPanel(),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user