Skip to content

Commit

Permalink
重命名下
Browse files Browse the repository at this point in the history
  • Loading branch information
kingslay committed Nov 23, 2023
1 parent 38f0a79 commit 154f828
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Sources/KSPlayer/AVPlayer/KSOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"

This comment has been minimized.

Copy link
@charsdavy

charsdavy Nov 24, 2023

遗漏了data

This comment has been minimized.

Copy link
@charsdavy

charsdavy Nov 24, 2023

还可以加上httpproxy,这样在设备开了网络代理工具的时候也能不受影响播放在线视频。

This comment has been minimized.

Copy link
@kingslay

kingslay Nov 24, 2023

Author Owner

httpproxy

可以加上,但是目前我已经增加了抓包的能力。setHttpProxy这个方法就可以支持Charles抓包了。但是这个是需要在播放之前就打开charles

// formatContextOptions["max_analyze_duration"] = 300 * 1000
formatContextOptions["reconnect"] = 1
// 开启这个,纯ipv6地址会无法播放。
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Sources/KSPlayer/MEPlayer/MEPlayerItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<MEPlayerItem>.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
Expand Down

0 comments on commit 154f828

Please sign in to comment.