From 5a55218c1175a381f40ece14f998b47962667379 Mon Sep 17 00:00:00 2001 From: orz12 Date: Sun, 12 Jan 2025 23:05:31 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E5=B0=9D=E8=AF=95=E4=BA=AE=E5=BA=A6?= =?UTF-8?q?=E5=BA=93=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/http/api.dart | 2 +- lib/http/video.dart | 4 ++-- lib/pages/setting/play_setting.dart | 1 + lib/plugin/pl_player/controller.dart | 8 ++++---- pubspec.yaml | 5 ++++- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/http/api.dart b/lib/http/api.dart index 8fe49cb13..2c337dc0f 100644 --- a/lib/http/api.dart +++ b/lib/http/api.dart @@ -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 diff --git a/lib/http/video.dart b/lib/http/video.dart index a7f0f96e9..43328c37e 100644 --- a/lib/http/video.dart +++ b/lib/http/video.dart @@ -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, diff --git a/lib/pages/setting/play_setting.dart b/lib/pages/setting/play_setting.dart index 9cae994b1..9e7a5a7d3 100644 --- a/lib/pages/setting/play_setting.dart +++ b/lib/pages/setting/play_setting.dart @@ -306,6 +306,7 @@ class _PlaySettingState extends State { leading: Icon(Icons.brightness_6_outlined), setKey: SettingBoxKey.setSystemBrightness, defaultVal: false, + needReboot: true, ), const SetSwitchItem( title: '后台音频服务', diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index adedea61c..1bfc11f66 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -565,7 +565,7 @@ class PlPlayerController { } await _initializePlayer(seekTo: seekTo); if (videoType.value != 'live' && _cid != 0) { - refreshSubtitles().then((_) { + refreshVideoMetaInfo().then((_) { chooseSubtitle(); }); } @@ -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; diff --git a/pubspec.yaml b/pubspec.yaml index 4ac6b98a8..0c6f463b5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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