This commit is contained in:
JinJiangHuang
2026-03-01 18:40:03 +08:00
parent a89ce6eb69
commit 3f302f83b3
3 changed files with 14 additions and 5 deletions
+3 -1
View File
@@ -19,7 +19,7 @@ struct DetailView: View {
ScrollView {
VStack(spacing: 0) {
//
if viewModel.isPlaying, let url = viewModel.playUrl, !showFullScreen {
if viewModel.isPlaying, let url = viewModel.playUrl {
PlayerView(
urlString: url,
startPosition: viewModel.currentPlaybackSeconds(),
@@ -38,6 +38,8 @@ struct DetailView: View {
.onTapGesture(count: 2) {
openFullScreenPlayer()
}
.opacity(showFullScreen ? 0 : 1)
.allowsHitTesting(!showFullScreen)
}
//
+9 -2
View File
@@ -169,7 +169,7 @@ final class VLCPlayerController: NSObject, ObservableObject, VLCMediaPlayerDeleg
cacheConfig.live += vodCacheBoostExtraLive
cacheConfig.file += vodCacheBoostExtraFile
}
let enableFrameDrop = isLive ? bufferMode.enableFrameDrop : true
let enableFrameDrop = isLive ? bufferMode.enableFrameDrop : false
let enableSkipFrames = isLive && bufferMode.enableFrameDrop
var mediaOptions: [String: Any] = [
"network-caching": cacheConfig.network,
@@ -179,6 +179,10 @@ final class VLCPlayerController: NSObject, ObservableObject, VLCMediaPlayerDeleg
"skip-frames": enableSkipFrames ? 1 : 0,
"http-reconnect": 1
]
if !isLive {
mediaOptions["avcodec-hurry-up"] = 0
mediaOptions["clock-jitter"] = 5000000
}
if let hwOption = decodeMode.vlcHardwareDecodeOption {
mediaOptions["avcodec-hw"] = hwOption
@@ -580,11 +584,14 @@ final class VLCPlayerController: NSObject, ObservableObject, VLCMediaPlayerDeleg
}
private func applyPlaybackRate() {
guard mediaPlayer.rate != playbackRate else { return }
mediaPlayer.rate = playbackRate
}
private func applyVolume() {
mediaPlayer.audio?.volume = Int32(volume)
let target = Int32(volume)
guard mediaPlayer.audio?.volume != target else { return }
mediaPlayer.audio?.volume = target
}
private func syncDecodeModeFromSettings() {