mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: 代码整理
This commit is contained in:
@@ -282,8 +282,7 @@ class PlPlayerController {
|
|||||||
danmakuDurationVal =
|
danmakuDurationVal =
|
||||||
localCache.get(LocalCacheKey.danmakuDuration, defaultValue: 4.0);
|
localCache.get(LocalCacheKey.danmakuDuration, defaultValue: 4.0);
|
||||||
// 描边粗细
|
// 描边粗细
|
||||||
strokeWidth =
|
strokeWidth = localCache.get(LocalCacheKey.strokeWidth, defaultValue: 1.5);
|
||||||
localCache.get(LocalCacheKey.strokeWidth, defaultValue: 1.5);
|
|
||||||
playRepeat = PlayRepeat.values.toList().firstWhere(
|
playRepeat = PlayRepeat.values.toList().firstWhere(
|
||||||
(e) =>
|
(e) =>
|
||||||
e.value ==
|
e.value ==
|
||||||
@@ -377,7 +376,9 @@ class PlPlayerController {
|
|||||||
// 获取视频时长 00:00
|
// 获取视频时长 00:00
|
||||||
_duration.value = duration ?? _videoPlayerController!.state.duration;
|
_duration.value = duration ?? _videoPlayerController!.state.duration;
|
||||||
updateDurationSecond();
|
updateDurationSecond();
|
||||||
|
if (videoType.value != 'live') {
|
||||||
refreshSubtitles();
|
refreshSubtitles();
|
||||||
|
}
|
||||||
// 数据加载完成
|
// 数据加载完成
|
||||||
dataStatus.status.value = DataStatus.loaded;
|
dataStatus.status.value = DataStatus.loaded;
|
||||||
|
|
||||||
@@ -433,7 +434,10 @@ class PlPlayerController {
|
|||||||
await pp.setProperty("volume-max", "100");
|
await pp.setProperty("volume-max", "100");
|
||||||
await pp.setProperty("ao", "audiotrack,opensles");
|
await pp.setProperty("ao", "audiotrack,opensles");
|
||||||
}
|
}
|
||||||
|
// // vo=gpu-next & gpu-context=android & gpu-api=opengl
|
||||||
|
// await pp.setProperty("vo", "gpu-next");
|
||||||
|
// await pp.setProperty("gpu-context", "android");
|
||||||
|
// await pp.setProperty("gpu-api", "opengl");
|
||||||
await player.setAudioTrack(
|
await player.setAudioTrack(
|
||||||
AudioTrack.auto(),
|
AudioTrack.auto(),
|
||||||
);
|
);
|
||||||
@@ -950,8 +954,10 @@ class PlPlayerController {
|
|||||||
if (!isFullScreen.value && status) {
|
if (!isFullScreen.value && status) {
|
||||||
// StatusBarControl.setHidden(true, animation: StatusBarAnimation.FADE);
|
// StatusBarControl.setHidden(true, animation: StatusBarAnimation.FADE);
|
||||||
hideStatusBar();
|
hideStatusBar();
|
||||||
|
|
||||||
/// 按照视频宽高比决定全屏方向
|
/// 按照视频宽高比决定全屏方向
|
||||||
toggleFullScreen(true);
|
toggleFullScreen(true);
|
||||||
|
|
||||||
/// 进入全屏
|
/// 进入全屏
|
||||||
FullScreenMode mode = FullScreenModeCode.fromCode(
|
FullScreenMode mode = FullScreenModeCode.fromCode(
|
||||||
setting.get(SettingBoxKey.fullScreenMode, defaultValue: 0))!;
|
setting.get(SettingBoxKey.fullScreenMode, defaultValue: 0))!;
|
||||||
@@ -1086,8 +1092,7 @@ class PlPlayerController {
|
|||||||
|
|
||||||
void refreshSubtitles() async {
|
void refreshSubtitles() async {
|
||||||
_vttSubtitles.clear();
|
_vttSubtitles.clear();
|
||||||
Map res = await VideoHttp.subtitlesJson(
|
Map res = await VideoHttp.subtitlesJson(bvid: _bvid, cid: _cid);
|
||||||
bvid: _bvid, cid: _cid);
|
|
||||||
if (!res["status"]) {
|
if (!res["status"]) {
|
||||||
SmartDialog.showToast('查询字幕错误,${res["msg"]}');
|
SmartDialog.showToast('查询字幕错误,${res["msg"]}');
|
||||||
}
|
}
|
||||||
@@ -1153,12 +1158,10 @@ class PlPlayerController {
|
|||||||
|
|
||||||
// 设定字幕轨道
|
// 设定字幕轨道
|
||||||
setSubtitle(Map<String, String> s) {
|
setSubtitle(Map<String, String> s) {
|
||||||
_videoPlayerController?.setSubtitleTrack(
|
_videoPlayerController?.setSubtitleTrack(SubtitleTrack.data(
|
||||||
SubtitleTrack.data(
|
|
||||||
s['text']!,
|
s['text']!,
|
||||||
title: s['title']!,
|
title: s['title']!,
|
||||||
language: s['language']!,
|
language: s['language']!,
|
||||||
)
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user