diff --git a/Sources/KSPlayer/AVPlayer/KSOptions.swift b/Sources/KSPlayer/AVPlayer/KSOptions.swift index 29381e8d4..4bebd7caa 100644 --- a/Sources/KSPlayer/AVPlayer/KSOptions.swift +++ b/Sources/KSPlayer/AVPlayer/KSOptions.swift @@ -110,6 +110,7 @@ open class KSOptions { formatContextOptions["scan_all_pmts"] = 1 formatContextOptions["auto_convert"] = 0 formatContextOptions["fps_probe_size"] = 3 + formatContextOptions["protocol_whitelist"] = "file,http,https,tcp,tls,crypto,async,cache" // formatContextOptions["max_analyze_duration"] = 300 * 1000 formatContextOptions["reconnect"] = 1 // 开启这个,纯ipv6地址会无法播放。 @@ -250,7 +251,7 @@ open class KSOptions { display == .plane } - open func io(log: String) { + open func urlIO(log: String) { if log.starts(with: "Original list of addresses"), dnsStartTime == 0 { dnsStartTime = CACurrentMediaTime() } else if log.starts(with: "Starting connection attempt to"), tcpStartTime == 0 { diff --git a/Sources/KSPlayer/MEPlayer/MEPlayerItem.swift b/Sources/KSPlayer/MEPlayer/MEPlayerItem.swift index bd19c3e92..23bbcef8a 100644 --- a/Sources/KSPlayer/MEPlayer/MEPlayerItem.swift +++ b/Sources/KSPlayer/MEPlayer/MEPlayerItem.swift @@ -107,7 +107,7 @@ final class MEPlayerItem { let context = ptr.assumingMemoryBound(to: URLContext.self).pointee if let opaque = context.interrupt_callback.opaque { let playerItem = Unmanaged.fromOpaque(opaque).takeUnretainedValue() - playerItem.options.io(log: log) + playerItem.options.urlIO(log: String(log)) if log.starts(with: "Will reconnect at") { let seconds = playerItem.mainClock().positionTime.seconds playerItem.videoTrack?.seekTime = seconds