Compare commits
1 Commits
feature-ab
...
fix-issues
| Author | SHA1 | Date | |
|---|---|---|---|
| 35dc94014c |
@ -53,54 +53,29 @@ class _AboutPageState extends State<AboutPage> {
|
|||||||
style: Theme.of(context).textTheme.titleMedium,
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
|
Text(
|
||||||
|
'使用Flutter开发的哔哩哔哩第三方客户端',
|
||||||
|
style: TextStyle(color: Theme.of(context).colorScheme.outline),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
Obx(
|
Obx(
|
||||||
() => Badge(
|
() => ListTile(
|
||||||
isLabelVisible: _aboutController.isLoading.value
|
title: const Text('当前版本'),
|
||||||
? false
|
trailing: Text(_aboutController.currentVersion.value,
|
||||||
: _aboutController.isUpdate.value,
|
style: subTitleStyle),
|
||||||
label: const Text('New'),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.fromLTRB(0, 0, 0, 30),
|
|
||||||
child: FilledButton.tonal(
|
|
||||||
onPressed: () {
|
|
||||||
showModalBottomSheet(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
ListTile(
|
|
||||||
onTap: () => _aboutController.githubRelease(),
|
|
||||||
title: const Text('Github下载'),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
onTap: () => _aboutController.panDownload(),
|
|
||||||
title: const Text('网盘下载'),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
onTap: () => _aboutController.webSiteUrl(),
|
|
||||||
title: const Text('官网下载'),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
onTap: () => _aboutController.qimiao(),
|
|
||||||
title: const Text('奇妙应用'),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height:
|
|
||||||
MediaQuery.of(context).padding.bottom +
|
|
||||||
20)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
'V${_aboutController.currentVersion.value}',
|
|
||||||
style: subTitleStyle.copyWith(
|
|
||||||
color: Theme.of(context).primaryColor,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Obx(
|
||||||
|
() => ListTile(
|
||||||
|
onTap: () => _aboutController.onUpdate(),
|
||||||
|
title: const Text('最新版本'),
|
||||||
|
trailing: Text(
|
||||||
|
_aboutController.isLoading.value
|
||||||
|
? '正在获取'
|
||||||
|
: _aboutController.isUpdate.value
|
||||||
|
? '有新版本 ❤️${_aboutController.remoteVersion.value}'
|
||||||
|
: '当前已是最新版',
|
||||||
|
style: subTitleStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -112,9 +87,14 @@ class _AboutPageState extends State<AboutPage> {
|
|||||||
// size: 16,
|
// size: 16,
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
|
Divider(
|
||||||
|
thickness: 1,
|
||||||
|
height: 30,
|
||||||
|
color: Theme.of(context).colorScheme.outlineVariant,
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () => _aboutController.githubUrl(),
|
onTap: () => _aboutController.githubUrl(),
|
||||||
title: const Text('开源地址'),
|
title: const Text('Github'),
|
||||||
trailing: Text(
|
trailing: Text(
|
||||||
'github.com/guozhigq/pilipala',
|
'github.com/guozhigq/pilipala',
|
||||||
style: subTitleStyle,
|
style: subTitleStyle,
|
||||||
@ -148,44 +128,20 @@ class _AboutPageState extends State<AboutPage> {
|
|||||||
color: outline,
|
color: outline,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ListTile(
|
|
||||||
onTap: () {
|
|
||||||
showModalBottomSheet(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () => _aboutController.qqChanel(),
|
onTap: () => _aboutController.qqChanel(),
|
||||||
title: const Text('QQ群'),
|
title: const Text('QQ群'),
|
||||||
trailing: Text(
|
|
||||||
'616150809',
|
|
||||||
style: subTitleStyle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
onTap: () => _aboutController.tgChanel(),
|
|
||||||
title: const Text('TG频道'),
|
|
||||||
trailing: Text(
|
|
||||||
'https://t.me/+lm_oOVmF0RJiODk1',
|
|
||||||
style: subTitleStyle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: MediaQuery.of(context).padding.bottom + 20)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
title: const Text('交流社区'),
|
|
||||||
trailing: Icon(
|
trailing: Icon(
|
||||||
Icons.arrow_forward_ios,
|
Icons.arrow_forward_ios,
|
||||||
size: 16,
|
size: 16,
|
||||||
color: outline,
|
color: outline,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
onTap: () => _aboutController.tgChanel(),
|
||||||
|
title: const Text('TG频道'),
|
||||||
|
trailing: Icon(Icons.arrow_forward_ios, size: 16, color: outline),
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () => _aboutController.aPay(),
|
onTap: () => _aboutController.aPay(),
|
||||||
title: const Text('赞助'),
|
title: const Text('赞助'),
|
||||||
@ -207,7 +163,6 @@ class _AboutPageState extends State<AboutPage> {
|
|||||||
subtitle: Text('图片及网络缓存 $cacheSize', style: subTitleStyle),
|
subtitle: Text('图片及网络缓存 $cacheSize', style: subTitleStyle),
|
||||||
trailing: Icon(Icons.arrow_forward_ios, size: 16, color: outline),
|
trailing: Icon(Icons.arrow_forward_ios, size: 16, color: outline),
|
||||||
),
|
),
|
||||||
SizedBox(height: MediaQuery.of(context).padding.bottom + 20)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -275,26 +230,11 @@ class AboutController extends GetxController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
githubRelease() {
|
|
||||||
launchUrl(
|
|
||||||
Uri.parse('https://github.com/guozhigq/pilipala/release'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 从网盘下载
|
// 从网盘下载
|
||||||
panDownload() {
|
panDownload() {
|
||||||
Clipboard.setData(
|
launchUrl(
|
||||||
const ClipboardData(text: 'pili'),
|
|
||||||
);
|
|
||||||
SmartDialog.showToast(
|
|
||||||
'已复制提取码:pili',
|
|
||||||
displayTime: const Duration(milliseconds: 500),
|
|
||||||
).then(
|
|
||||||
(value) => launchUrl(
|
|
||||||
Uri.parse('https://www.123pan.com/s/9sVqVv-flu0A.html'),
|
Uri.parse('https://www.123pan.com/s/9sVqVv-flu0A.html'),
|
||||||
mode: LaunchMode.externalApplication,
|
mode: LaunchMode.externalApplication,
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,7 +250,7 @@ class AboutController extends GetxController {
|
|||||||
// qq频道
|
// qq频道
|
||||||
qqChanel() {
|
qqChanel() {
|
||||||
Clipboard.setData(
|
Clipboard.setData(
|
||||||
const ClipboardData(text: '616150809'),
|
const ClipboardData(text: '489981949'),
|
||||||
);
|
);
|
||||||
SmartDialog.showToast('已复制QQ群号');
|
SmartDialog.showToast('已复制QQ群号');
|
||||||
}
|
}
|
||||||
@ -351,13 +291,6 @@ class AboutController extends GetxController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
qimiao() {
|
|
||||||
launchUrl(
|
|
||||||
Uri.parse('https://www.magicalapk.com/home'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 日志
|
// 日志
|
||||||
logs() {
|
logs() {
|
||||||
Get.toNamed('/logs');
|
Get.toNamed('/logs');
|
||||||
|
|||||||
@ -26,7 +26,6 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
|
|||||||
late List defaultTabs;
|
late List defaultTabs;
|
||||||
late List<String> tabbarSort;
|
late List<String> tabbarSort;
|
||||||
RxString defaultSearch = ''.obs;
|
RxString defaultSearch = ''.obs;
|
||||||
late bool enableGradientBg;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
@ -41,8 +40,6 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
|
|||||||
if (setting.get(SettingBoxKey.enableSearchWord, defaultValue: true)) {
|
if (setting.get(SettingBoxKey.enableSearchWord, defaultValue: true)) {
|
||||||
searchDefault();
|
searchDefault();
|
||||||
}
|
}
|
||||||
enableGradientBg =
|
|
||||||
setting.get(SettingBoxKey.enableGradientBg, defaultValue: true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onRefresh() {
|
void onRefresh() {
|
||||||
|
|||||||
@ -48,20 +48,17 @@ class _HomePageState extends State<HomePage>
|
|||||||
super.build(context);
|
super.build(context);
|
||||||
Brightness currentBrightness = MediaQuery.of(context).platformBrightness;
|
Brightness currentBrightness = MediaQuery.of(context).platformBrightness;
|
||||||
// 设置状态栏图标的亮度
|
// 设置状态栏图标的亮度
|
||||||
if (_homeController.enableGradientBg) {
|
|
||||||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
||||||
statusBarIconBrightness: currentBrightness == Brightness.light
|
statusBarIconBrightness: currentBrightness == Brightness.light
|
||||||
? Brightness.dark
|
? Brightness.dark
|
||||||
: Brightness.light,
|
: Brightness.light,
|
||||||
));
|
));
|
||||||
}
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
// gradient background
|
// gradient background
|
||||||
if (_homeController.enableGradientBg) ...[
|
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.topLeft,
|
alignment: Alignment.topLeft,
|
||||||
child: Opacity(
|
child: Opacity(
|
||||||
@ -72,14 +69,8 @@ class _HomePageState extends State<HomePage>
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
colors: [
|
colors: [
|
||||||
Theme.of(context)
|
Theme.of(context).colorScheme.primary.withOpacity(0.9),
|
||||||
.colorScheme
|
Theme.of(context).colorScheme.primary.withOpacity(0.5),
|
||||||
.primary
|
|
||||||
.withOpacity(0.9),
|
|
||||||
Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.primary
|
|
||||||
.withOpacity(0.5),
|
|
||||||
Theme.of(context).colorScheme.surface
|
Theme.of(context).colorScheme.surface
|
||||||
],
|
],
|
||||||
begin: Alignment.topLeft,
|
begin: Alignment.topLeft,
|
||||||
@ -89,7 +80,6 @@ class _HomePageState extends State<HomePage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
CustomAppBar(
|
CustomAppBar(
|
||||||
@ -100,37 +90,7 @@ class _HomePageState extends State<HomePage>
|
|||||||
callback: showUserBottomSheet,
|
callback: showUserBottomSheet,
|
||||||
),
|
),
|
||||||
if (_homeController.tabs.length > 1) ...[
|
if (_homeController.tabs.length > 1) ...[
|
||||||
if (_homeController.enableGradientBg) ...[
|
|
||||||
const CustomTabs(),
|
const CustomTabs(),
|
||||||
] else ...[
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
SizedBox(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 42,
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: TabBar(
|
|
||||||
controller: _homeController.tabController,
|
|
||||||
tabs: [
|
|
||||||
for (var i in _homeController.tabs)
|
|
||||||
Tab(text: i['label'])
|
|
||||||
],
|
|
||||||
isScrollable: true,
|
|
||||||
dividerColor: Colors.transparent,
|
|
||||||
enableFeedback: true,
|
|
||||||
splashBorderRadius: BorderRadius.circular(10),
|
|
||||||
tabAlignment: TabAlignment.center,
|
|
||||||
onTap: (value) {
|
|
||||||
feedBack();
|
|
||||||
if (_homeController.initialIndex.value == value) {
|
|
||||||
_homeController.tabsCtrList[value]().animateToTop();
|
|
||||||
}
|
|
||||||
_homeController.initialIndex.value = value;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
] else ...[
|
] else ...[
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import 'package:pilipala/http/live.dart';
|
|||||||
import 'package:pilipala/models/live/room_info.dart';
|
import 'package:pilipala/models/live/room_info.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||||
import '../../models/live/room_info_h5.dart';
|
import '../../models/live/room_info_h5.dart';
|
||||||
|
import '../../utils/storage.dart';
|
||||||
|
import '../../utils/video_utils.dart';
|
||||||
|
|
||||||
class LiveRoomController extends GetxController {
|
class LiveRoomController extends GetxController {
|
||||||
String cover = '';
|
String cover = '';
|
||||||
@ -16,6 +18,7 @@ class LiveRoomController extends GetxController {
|
|||||||
PlPlayerController plPlayerController =
|
PlPlayerController plPlayerController =
|
||||||
PlPlayerController.getInstance(videoType: 'live');
|
PlPlayerController.getInstance(videoType: 'live');
|
||||||
Rx<RoomInfoH5Model> roomInfoH5 = RoomInfoH5Model().obs;
|
Rx<RoomInfoH5Model> roomInfoH5 = RoomInfoH5Model().obs;
|
||||||
|
late bool enableCDN;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
@ -31,6 +34,8 @@ class LiveRoomController extends GetxController {
|
|||||||
cover = liveItem.cover;
|
cover = liveItem.cover;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// CDN优化
|
||||||
|
enableCDN = setting.get(SettingBoxKey.enableCDN, defaultValue: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
playerInit(source) async {
|
playerInit(source) async {
|
||||||
@ -57,7 +62,9 @@ class LiveRoomController extends GetxController {
|
|||||||
List<CodecItem> codec =
|
List<CodecItem> codec =
|
||||||
res['data'].playurlInfo.playurl.stream.first.format.first.codec;
|
res['data'].playurlInfo.playurl.stream.first.format.first.codec;
|
||||||
CodecItem item = codec.first;
|
CodecItem item = codec.first;
|
||||||
String videoUrl = (item.urlInfo?.first.host)! +
|
String videoUrl = enableCDN
|
||||||
|
? VideoUtils.getCdnUrl(item)
|
||||||
|
: (item.urlInfo?.first.host)! +
|
||||||
item.baseUrl! +
|
item.baseUrl! +
|
||||||
item.urlInfo!.first.extra!;
|
item.urlInfo!.first.extra!;
|
||||||
await playerInit(videoUrl);
|
await playerInit(videoUrl);
|
||||||
|
|||||||
@ -102,12 +102,6 @@ class _StyleSettingState extends State<StyleSetting> {
|
|||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
needReboot: true,
|
needReboot: true,
|
||||||
),
|
),
|
||||||
const SetSwitchItem(
|
|
||||||
title: '首页底栏背景渐变',
|
|
||||||
setKey: SettingBoxKey.enableGradientBg,
|
|
||||||
defaultVal: true,
|
|
||||||
needReboot: true,
|
|
||||||
),
|
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
int? result = await showDialog(
|
int? result = await showDialog(
|
||||||
|
|||||||
@ -135,8 +135,7 @@ class SettingBoxKey {
|
|||||||
hideSearchBar = 'hideSearchBar', // 收起顶栏
|
hideSearchBar = 'hideSearchBar', // 收起顶栏
|
||||||
hideTabBar = 'hideTabBar', // 收起底栏
|
hideTabBar = 'hideTabBar', // 收起底栏
|
||||||
tabbarSort = 'tabbarSort', // 首页tabbar
|
tabbarSort = 'tabbarSort', // 首页tabbar
|
||||||
dynamicBadgeMode = 'dynamicBadgeMode',
|
dynamicBadgeMode = 'dynamicBadgeMode';
|
||||||
enableGradientBg = 'enableGradientBg';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class LocalCacheKey {
|
class LocalCacheKey {
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import 'package:pilipala/models/video/play/url.dart';
|
import 'package:pilipala/models/video/play/url.dart';
|
||||||
|
|
||||||
|
import '../models/live/room_info.dart';
|
||||||
|
|
||||||
class VideoUtils {
|
class VideoUtils {
|
||||||
static String getCdnUrl(dynamic item) {
|
static String getCdnUrl(dynamic item) {
|
||||||
var backupUrl = "";
|
var backupUrl = "";
|
||||||
@ -12,13 +14,20 @@ class VideoUtils {
|
|||||||
} else if (item is AudioItem) {
|
} else if (item is AudioItem) {
|
||||||
backupUrl = item.backupUrl ?? "";
|
backupUrl = item.backupUrl ?? "";
|
||||||
videoUrl = backupUrl.contains("http") ? backupUrl : (item.baseUrl ?? "");
|
videoUrl = backupUrl.contains("http") ? backupUrl : (item.baseUrl ?? "");
|
||||||
|
} else if (item is CodecItem) {
|
||||||
|
backupUrl = (item.urlInfo?.first.host)! +
|
||||||
|
item.baseUrl! +
|
||||||
|
item.urlInfo!.first.extra!;
|
||||||
|
videoUrl = backupUrl.contains("http") ? backupUrl : (item.baseUrl ?? "");
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// issues #70
|
/// issues #70
|
||||||
if (videoUrl.contains(".mcdn.bilivideo") ||
|
if (videoUrl.contains(".mcdn.bilivideo")) {
|
||||||
videoUrl.contains("/upgcxcode/")) {
|
videoUrl =
|
||||||
|
'https://proxy-tf-all-ws.bilivideo.com/?url=${Uri.encodeComponent(videoUrl)}';
|
||||||
|
} else if (videoUrl.contains("/upgcxcode/")) {
|
||||||
//CDN列表
|
//CDN列表
|
||||||
var cdnList = {
|
var cdnList = {
|
||||||
'ali': 'upos-sz-mirrorali.bilivideo.com',
|
'ali': 'upos-sz-mirrorali.bilivideo.com',
|
||||||
|
|||||||
Reference in New Issue
Block a user