Skip to content

Commit

Permalink
mod: 尝试亮度库修复
Browse files Browse the repository at this point in the history
  • Loading branch information
orz12 committed Jan 12, 2025
1 parent f9d5cf9 commit 5a55218
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/http/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Api {

// 字幕
// aid, cid
static const String subtitleUrl = '/x/player/wbi/v2';
static const String videoMetaInfo = '/x/player/wbi/v2';

// 视频详情
// 竖屏 https://api.bilibili.com/x/web-interface/view?aid=527403921
Expand Down
4 changes: 2 additions & 2 deletions lib/http/video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -668,10 +668,10 @@ class VideoHttp {
}
}

static Future subtitlesJson(
static Future videoMetaInfo(
{String? aid, String? bvid, required int cid}) async {
assert(aid != null || bvid != null);
var res = await Request().get(Api.subtitleUrl, data: {
var res = await Request().get(Api.videoMetaInfo, data: {
if (aid != null) 'aid': aid,
if (bvid != null) 'bvid': bvid,
'cid': cid,
Expand Down
1 change: 1 addition & 0 deletions lib/pages/setting/play_setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ class _PlaySettingState extends State<PlaySetting> {
leading: Icon(Icons.brightness_6_outlined),
setKey: SettingBoxKey.setSystemBrightness,
defaultVal: false,
needReboot: true,
),
const SetSwitchItem(
title: '后台音频服务',
Expand Down
8 changes: 4 additions & 4 deletions lib/plugin/pl_player/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ class PlPlayerController {
}
await _initializePlayer(seekTo: seekTo);
if (videoType.value != 'live' && _cid != 0) {
refreshSubtitles().then((_) {
refreshVideoMetaInfo().then((_) {
chooseSubtitle();
});
}
Expand Down Expand Up @@ -1633,11 +1633,11 @@ class PlPlayerController {
}
}

Future refreshSubtitles() async {
Future refreshVideoMetaInfo() async {
_vttSubtitles.clear();
Map res = await VideoHttp.subtitlesJson(bvid: _bvid, cid: _cid);
Map res = await VideoHttp.videoMetaInfo(bvid: _bvid, cid: _cid);
if (!res["status"]) {
SmartDialog.showToast('查询字幕错误,${res["msg"]}');
SmartDialog.showToast('查询视频元信息(字幕、防挡、章节等)错误,${res["msg"]}');
}
if (res["data"].length == 0) {
return;
Expand Down
5 changes: 4 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ dependency_overrides:
# ref: main
fading_edge_scrollview: ^4.1.1
rxdart: ^0.28.0
screen_brightness: ^2.0.1
screen_brightness:
git:
url: https://github.com/aaassseee/screen_brightness.git
ref: bugfix/failed-to-build-ios-and-mac
# media_kit:
# git:
# url: https://github.com/media-kit/media-kit.git
Expand Down

0 comments on commit 5a55218

Please sign in to comment.