fix bugs
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
// 视频信息
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user