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