mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
committed by
GitHub
parent
007375371e
commit
8e726f49b2
@@ -804,8 +804,6 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final Map<String, String> extras = {};
|
|
||||||
|
|
||||||
// 音轨
|
// 音轨
|
||||||
final String audioUri;
|
final String audioUri;
|
||||||
if (isFileSource) {
|
if (isFileSource) {
|
||||||
@@ -819,7 +817,7 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
} else {
|
} else {
|
||||||
audioUri = '';
|
audioUri = '';
|
||||||
}
|
}
|
||||||
if (audioUri.isNotEmpty) extras['audio-files'] = '"$audioUri"';
|
await pp.setProperty('audio-files', audioUri);
|
||||||
|
|
||||||
_videoController ??= VideoController(
|
_videoController ??= VideoController(
|
||||||
player,
|
player,
|
||||||
@@ -832,7 +830,8 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
|
|
||||||
player.setPlaylistMode(looping);
|
player.setPlaylistMode(looping);
|
||||||
|
|
||||||
if (kDebugMode || Platform.isAndroid) {
|
final Map<String, String>? filters;
|
||||||
|
if (Platform.isAndroid) {
|
||||||
String audioNormalization = AudioNormalization.getParamFromConfig(
|
String audioNormalization = AudioNormalization.getParamFromConfig(
|
||||||
Pref.audioNormalization,
|
Pref.audioNormalization,
|
||||||
);
|
);
|
||||||
@@ -855,9 +854,11 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
AudioNormalization.getParamFromConfig(Pref.fallbackNormalization),
|
AudioNormalization.getParamFromConfig(Pref.fallbackNormalization),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (audioNormalization.isNotEmpty) {
|
filters = audioNormalization.isEmpty
|
||||||
extras['lavfi-complex'] = '"[aid1] $audioNormalization [ao]"';
|
? null
|
||||||
}
|
: {'lavfi-complex': '"[aid1] $audioNormalization [ao]"'};
|
||||||
|
} else {
|
||||||
|
filters = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (kDebugMode) debugPrint(filters.toString());
|
// if (kDebugMode) debugPrint(filters.toString());
|
||||||
@@ -881,7 +882,7 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
videoUri,
|
videoUri,
|
||||||
httpHeaders: dataSource.httpHeaders,
|
httpHeaders: dataSource.httpHeaders,
|
||||||
start: seekTo,
|
start: seekTo,
|
||||||
extras: extras.isEmpty ? null : extras,
|
extras: filters,
|
||||||
),
|
),
|
||||||
play: false,
|
play: false,
|
||||||
);
|
);
|
||||||
@@ -901,14 +902,16 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
SmartDialog.showToast('视频源为空,请重新进入本页面');
|
SmartDialog.showToast('视频源为空,请重新进入本页面');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String? audioUri;
|
|
||||||
if (!isLive) {
|
if (!isLive) {
|
||||||
if (dataSource.audioSource.isNullOrEmpty) {
|
if (dataSource.audioSource.isNullOrEmpty) {
|
||||||
SmartDialog.showToast('音频源为空');
|
SmartDialog.showToast('音频源为空');
|
||||||
} else {
|
} else {
|
||||||
audioUri = Platform.isWindows
|
await (_videoPlayerController!.platform!).setProperty(
|
||||||
? dataSource.audioSource!.replaceAll(';', '\\;')
|
'audio-files',
|
||||||
: dataSource.audioSource!.replaceAll(':', '\\:');
|
Platform.isWindows
|
||||||
|
? dataSource.audioSource!.replaceAll(';', '\\;')
|
||||||
|
: dataSource.audioSource!.replaceAll(':', '\\:'),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await _videoPlayerController!.open(
|
await _videoPlayerController!.open(
|
||||||
@@ -916,7 +919,6 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
dataSource.videoSource!,
|
dataSource.videoSource!,
|
||||||
httpHeaders: dataSource.httpHeaders,
|
httpHeaders: dataSource.httpHeaders,
|
||||||
start: position,
|
start: position,
|
||||||
extras: audioUri == null ? null : {'audio-files': '"$audioUri"'},
|
|
||||||
),
|
),
|
||||||
play: true,
|
play: true,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user