fix: 直播音轨
This commit is contained in:
@ -375,9 +375,10 @@ class PlPlayerController {
|
||||
}
|
||||
Player player = _videoPlayerController ??
|
||||
Player(
|
||||
configuration: const PlayerConfiguration(
|
||||
configuration: PlayerConfiguration(
|
||||
// 默认缓存 5M 大小
|
||||
bufferSize: 5 * 1024 * 1024,
|
||||
bufferSize:
|
||||
videoType.value == 'live' ? 32 * 1024 * 1024 : 5 * 1024 * 1024,
|
||||
),
|
||||
);
|
||||
|
||||
@ -390,6 +391,10 @@ class PlPlayerController {
|
||||
await pp.setProperty("ao", "audiotrack,opensles");
|
||||
}
|
||||
|
||||
await player.setAudioTrack(
|
||||
AudioTrack.auto(),
|
||||
);
|
||||
|
||||
// 音轨
|
||||
if (dataSource.audioSource != '' && dataSource.audioSource != null) {
|
||||
await pp.setProperty(
|
||||
@ -398,6 +403,11 @@ class PlPlayerController {
|
||||
? dataSource.audioSource!.replaceAll(';', '\\;')
|
||||
: dataSource.audioSource!.replaceAll(':', '\\:'),
|
||||
);
|
||||
} else {
|
||||
await pp.setProperty(
|
||||
'audio-files',
|
||||
'',
|
||||
);
|
||||
}
|
||||
|
||||
// 字幕
|
||||
|
Reference in New Issue
Block a user