mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
fix: 默认字幕偏好错误、全屏逻辑独立、新增全屏不转方向、字幕无法关闭
This commit is contained in:
@@ -389,7 +389,7 @@ class PlPlayerController {
|
||||
refreshSubtitles().then((value) {
|
||||
if (_vttSubtitles.isNotEmpty){
|
||||
String preference = setting.get(SettingBoxKey.subtitlePreference,
|
||||
defaultValue: SubtitlePreference.values.first.index);
|
||||
defaultValue: SubtitlePreference.values.first.code);
|
||||
if (preference == 'on') {
|
||||
setSubtitle(vttSubtitles[1]);
|
||||
} else if (preference == 'withoutAi') {
|
||||
@@ -545,6 +545,15 @@ class PlPlayerController {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> autoEnterFullscreen() async {
|
||||
bool autoEnterFullscreen =
|
||||
GStrorage.setting.get(SettingBoxKey.enableAutoEnter, defaultValue: false);
|
||||
if (autoEnterFullscreen) {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
triggerFullScreen(status: true);
|
||||
}
|
||||
}
|
||||
|
||||
List<StreamSubscription> subscriptions = [];
|
||||
final List<Function(Duration position)> _positionListeners = [];
|
||||
final List<Function(PlayerStatus status)> _statusListeners = [];
|
||||
@@ -975,6 +984,9 @@ class PlPlayerController {
|
||||
/// 进入全屏
|
||||
FullScreenMode mode = FullScreenModeCode.fromCode(
|
||||
setting.get(SettingBoxKey.fullScreenMode, defaultValue: 0))!;
|
||||
if (mode == FullScreenMode.none) {
|
||||
return;
|
||||
}
|
||||
if (mode == FullScreenMode.vertical ||
|
||||
(mode == FullScreenMode.auto && direction.value == 'vertical') ||
|
||||
(mode == FullScreenMode.ratio &&
|
||||
@@ -1122,7 +1134,7 @@ class PlPlayerController {
|
||||
|
||||
// 设定字幕轨道
|
||||
setSubtitle(Map<String, String> s) {
|
||||
if (s['text'] == null) {
|
||||
if (s['text'] == '') {
|
||||
_videoPlayerController?.setSubtitleTrack(SubtitleTrack.no());
|
||||
_vttSubtitlesIndex.value = 0;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user