Build Information
Successful build of KSPlayer, reference 2.3.4 (bdfa2d
), with Swift 6.2 (beta) for macOS (SPM) on 19 Jun 2025 03:11:18 UTC.
Swift 6 data race errors: 0
Build Command
env DEVELOPER_DIR=/Applications/Xcode-26.0.0-Beta.app xcrun swift build --arch arm64
Build Log
85 | pipController.start(view: self)
86 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:85:25: warning: sending 'pipController' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
83 | DispatchQueue.main.async { [weak self] in
84 | guard let self else { return }
85 | pipController.start(view: self)
| |- warning: sending 'pipController' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: task-isolated 'pipController' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
86 | }
87 | } else {
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:169:36: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
167 | guard let self else { return }
168 | KSLog("playerStateDidChange - \(newValue)")
169 | self.delegate?.player(layer: self, state: newValue)
| |- warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending task-isolated 'self' to main actor-isolated instance method 'player(layer:state:)' risks causing data races between main actor-isolated and task-isolated uses
170 | }
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:169:36: warning: sending 'newValue' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
167 | guard let self else { return }
168 | KSLog("playerStateDidChange - \(newValue)")
169 | self.delegate?.player(layer: self, state: newValue)
| |- warning: sending 'newValue' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending task-isolated 'newValue' to main actor-isolated instance method 'player(layer:state:)' risks causing data races between main actor-isolated and task-isolated uses
170 | }
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:169:36: warning: sending value of non-Sendable type 'any KSPlayerLayerDelegate' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
167 | guard let self else { return }
168 | KSLog("playerStateDidChange - \(newValue)")
169 | self.delegate?.player(layer: self, state: newValue)
| |- warning: sending value of non-Sendable type 'any KSPlayerLayerDelegate' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending task-isolated value of non-Sendable type 'any KSPlayerLayerDelegate' to main actor-isolated instance method 'player(layer:state:)' risks causing races in between task-isolated and main actor-isolated uses
170 | }
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:179:24: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
177 | return
178 | }
179 | self.delegate?.player(layer: self, currentTime: self.player.currentPlaybackTime, totalTime: self.player.duration)
| |- warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending 'self' to main actor-isolated instance method 'player(layer:currentTime:totalTime:)' risks causing data races between main actor-isolated and local nonisolated uses
180 | if self.player.playbackState == .playing, self.player.loadState == .playable, self.state == .buffering {
| `- note: access can happen concurrently
181 | // 一个兜底保护,正常不能走到这里
182 | self.state = .bufferFinished
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:179:24: warning: sending value of non-Sendable type 'any KSPlayerLayerDelegate' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
177 | return
178 | }
179 | self.delegate?.player(layer: self, currentTime: self.player.currentPlaybackTime, totalTime: self.player.duration)
| |- warning: sending value of non-Sendable type 'any KSPlayerLayerDelegate' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending value of non-Sendable type 'any KSPlayerLayerDelegate' to main actor-isolated instance method 'player(layer:currentTime:totalTime:)' risks causing data races between main actor-isolated and local nonisolated uses
180 | if self.player.playbackState == .playing, self.player.loadState == .playable, self.state == .buffering {
| `- note: access can happen concurrently
181 | // 一个兜底保护,正常不能走到这里
182 | self.state = .bufferFinished
[#ActorIsolatedCall]: <https://docs.swift.org/compiler/documentation/diagnostics/actor-isolated-call>
[#ConformanceIsolation]: <https://docs.swift.org/compiler/documentation/diagnostics/conformance-isolation>
[#MutableGlobalVariable]: <https://docs.swift.org/compiler/documentation/diagnostics/mutable-global-variable>
[#SendableClosureCaptures]: <https://docs.swift.org/compiler/documentation/diagnostics/sendable-closure-captures>
[#SendingRisksDataRace]: <https://docs.swift.org/compiler/documentation/diagnostics/sending-risks-data-race>
[90/91] Compiling KSPlayer KSVideoPlayer.swift
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:362:23: warning: conformance of 'KSAVPlayer' to protocol 'MediaPlayerProtocol' crosses into main actor-isolated code and can cause data races; this is an error in the Swift 6 language mode [#ConformanceIsolation]
109 |
110 | @available(tvOS 14.0, *)
111 | public var pipController: KSPictureInPictureController? {
| `- note: main actor-isolated property 'pipController' cannot satisfy nonisolated requirement
112 | _pipController as? KSPictureInPictureController
113 | }
114 |
115 | public var naturalSize: CGSize = .zero
116 | public let dynamicInfo: DynamicInfo? = nil
| `- note: main actor-isolated property 'dynamicInfo' cannot satisfy nonisolated requirement
117 | @available(macOS 12.0, iOS 15.0, tvOS 15.0, *)
118 | public var playbackCoordinator: AVPlaybackCoordinator {
| `- note: main actor-isolated property 'playbackCoordinator' cannot satisfy nonisolated requirement
119 | playerView.player.playbackCoordinator
120 | }
:
126 | }
127 |
128 | public weak var delegate: MediaPlayerDelegate?
| `- note: main actor-isolated property 'delegate' cannot satisfy nonisolated requirement
129 | public private(set) var duration: TimeInterval = 0
130 | public private(set) var fileSize: Double = 0
131 | public private(set) var playableTime: TimeInterval = 0
| `- note: main actor-isolated property 'playableTime' cannot satisfy nonisolated requirement
132 | public let chapters: [Chapter] = []
133 | public var playbackRate: Float = 1 {
| `- note: main actor-isolated property 'playbackRate' cannot satisfy nonisolated requirement
134 | didSet {
135 | if playbackState == .playing {
:
139 | }
140 |
141 | public var playbackVolume: Float = 1.0 {
| `- note: main actor-isolated property 'playbackVolume' cannot satisfy nonisolated requirement
142 | didSet {
143 | if player.volume != playbackVolume {
:
147 | }
148 |
149 | public private(set) var loadState = MediaLoadState.idle {
| `- note: main actor-isolated property 'loadState' cannot satisfy nonisolated requirement
150 | didSet {
151 | if loadState != oldValue {
:
158 | }
159 |
160 | public private(set) var playbackState = MediaPlaybackState.idle {
| `- note: main actor-isolated property 'playbackState' cannot satisfy nonisolated requirement
161 | didSet {
162 | if playbackState != oldValue {
:
169 | }
170 |
171 | public private(set) var isReadyToPlay = false {
| `- note: main actor-isolated property 'isReadyToPlay' cannot satisfy nonisolated requirement
172 | didSet {
173 | if isReadyToPlay != oldValue {
:
185 | public let isExternalPlaybackActive = false
186 | #else
187 | public var allowsExternalPlayback: Bool {
| `- note: main actor-isolated property 'allowsExternalPlayback' cannot satisfy nonisolated requirement
188 | get {
189 | player.allowsExternalPlayback
:
195 |
196 | #if os(macOS)
197 | public var usesExternalPlaybackWhileExternalScreenIsActive = false
| `- note: main actor-isolated property 'usesExternalPlaybackWhileExternalScreenIsActive' cannot satisfy nonisolated requirement
198 | #else
199 | public var usesExternalPlaybackWhileExternalScreenIsActive: Bool {
:
207 | #endif
208 |
209 | public var isExternalPlaybackActive: Bool {
| `- note: main actor-isolated property 'isExternalPlaybackActive' cannot satisfy nonisolated requirement
210 | player.isExternalPlaybackActive
211 | }
212 | #endif
213 |
214 | public required init(url: URL, options: KSOptions) {
| `- note: main actor-isolated initializer 'init(url:options:)' cannot satisfy nonisolated requirement
215 | KSOptions.setAudioSession()
216 | urlAsset = AVURLAsset(url: url, options: options.avOptions)
:
360 | }
361 |
362 | extension KSAVPlayer: MediaPlayerProtocol {
| | |- warning: conformance of 'KSAVPlayer' to protocol 'MediaPlayerProtocol' crosses into main actor-isolated code and can cause data races; this is an error in the Swift 6 language mode [#ConformanceIsolation]
| | |- note: isolate this conformance to the main actor with '@MainActor'
| | `- note: turn data races into runtime errors with '@preconcurrency'
| `- note: mark all declarations used in the conformance 'nonisolated'
363 | public var subtitleDataSouce: SubtitleDataSouce? { nil }
| `- note: main actor-isolated property 'subtitleDataSouce' cannot satisfy nonisolated requirement
364 | public var isPlaying: Bool { player.rate > 0 ? true : playbackState == .playing }
| `- note: main actor-isolated property 'isPlaying' cannot satisfy nonisolated requirement
365 | public var view: UIView? { playerView }
| `- note: main actor-isolated property 'view' cannot satisfy nonisolated requirement
366 | public var currentPlaybackTime: TimeInterval {
367 | get {
:
427 | }
428 |
429 | public func play() {
| `- note: main actor-isolated instance method 'play()' cannot satisfy nonisolated requirement
430 | KSLog("play \(self)")
431 | playbackState = .playing
432 | }
433 |
434 | public func pause() {
| `- note: main actor-isolated instance method 'pause()' cannot satisfy nonisolated requirement
435 | KSLog("pause \(self)")
436 | playbackState = .paused
:
446 | }
447 |
448 | public func replace(url: URL, options: KSOptions) {
| `- note: main actor-isolated instance method 'replace(url:options:)' cannot satisfy nonisolated requirement
449 | KSLog("replaceUrl \(self)")
450 | shutdown()
:
453 | }
454 |
455 | public var contentMode: UIViewContentMode {
| `- note: main actor-isolated property 'contentMode' cannot satisfy nonisolated requirement
456 | get {
457 | playerView.contentMode
:
462 | }
463 |
464 | public func enterBackground() {
| `- note: main actor-isolated instance method 'enterBackground()' cannot satisfy nonisolated requirement
465 | playerView.playerLayer.player = nil
466 | }
467 |
468 | public func enterForeground() {
| `- note: main actor-isolated instance method 'enterForeground()' cannot satisfy nonisolated requirement
469 | playerView.playerLayer.player = playerView.player
470 | }
471 |
472 | public var seekable: Bool {
| `- note: main actor-isolated property 'seekable' cannot satisfy nonisolated requirement
473 | !(player.currentItem?.seekableTimeRanges.isEmpty ?? true)
474 | }
475 |
476 | public var isMuted: Bool {
| `- note: main actor-isolated property 'isMuted' cannot satisfy nonisolated requirement
477 | get {
478 | player.isMuted
:
483 | }
484 |
485 | public func tracks(mediaType: AVFoundation.AVMediaType) -> [MediaPlayerTrack] {
| `- note: main actor-isolated instance method 'tracks(mediaType:)' cannot satisfy nonisolated requirement
486 | player.currentItem?.tracks.filter { $0.assetTrack?.mediaType == mediaType }.map { AVMediaPlayerTrack(track: $0) } ?? []
487 | }
488 |
489 | public func select(track: some MediaPlayerTrack) {
| `- note: main actor-isolated instance method 'select(track:)' cannot satisfy nonisolated requirement
490 | player.currentItem?.tracks.filter { $0.assetTrack?.mediaType == track.mediaType }.forEach { $0.isEnabled = false }
491 | track.isEnabled = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:362:1: warning: conformance of 'KSAVPlayer' to protocol 'MediaPlayback' crosses into main actor-isolated code and can cause data races; this is an error in the Swift 6 language mode [#ConformanceIsolation]
113 | }
114 |
115 | public var naturalSize: CGSize = .zero
| `- note: main actor-isolated property 'naturalSize' cannot satisfy nonisolated requirement
116 | public let dynamicInfo: DynamicInfo? = nil
117 | @available(macOS 12.0, iOS 15.0, tvOS 15.0, *)
:
127 |
128 | public weak var delegate: MediaPlayerDelegate?
129 | public private(set) var duration: TimeInterval = 0
| `- note: main actor-isolated property 'duration' cannot satisfy nonisolated requirement
130 | public private(set) var fileSize: Double = 0
| `- note: main actor-isolated property 'fileSize' cannot satisfy nonisolated requirement
131 | public private(set) var playableTime: TimeInterval = 0
132 | public let chapters: [Chapter] = []
| `- note: main actor-isolated property 'chapters' cannot satisfy nonisolated requirement
133 | public var playbackRate: Float = 1 {
134 | didSet {
:
360 | }
361 |
362 | extension KSAVPlayer: MediaPlayerProtocol {
| |- warning: conformance of 'KSAVPlayer' to protocol 'MediaPlayback' crosses into main actor-isolated code and can cause data races; this is an error in the Swift 6 language mode [#ConformanceIsolation]
| |- note: isolate this conformance to the main actor with '@MainActor'
| |- note: mark all declarations used in the conformance 'nonisolated'
| `- note: turn data races into runtime errors with '@preconcurrency'
363 | public var subtitleDataSouce: SubtitleDataSouce? { nil }
364 | public var isPlaying: Bool { player.rate > 0 ? true : playbackState == .playing }
365 | public var view: UIView? { playerView }
366 | public var currentPlaybackTime: TimeInterval {
| `- note: main actor-isolated property 'currentPlaybackTime' cannot satisfy nonisolated requirement
367 | get {
368 | if shouldSeekTo > 0 {
:
397 | }
398 |
399 | public func seek(time: TimeInterval, completion: @escaping ((Bool) -> Void)) {
| `- note: main actor-isolated instance method 'seek(time:completion:)' cannot satisfy nonisolated requirement
400 | let time = max(time, 0)
401 | shouldSeekTo = time
:
413 | }
414 |
415 | public func prepareToPlay() {
| `- note: main actor-isolated instance method 'prepareToPlay()' cannot satisfy nonisolated requirement
416 | KSLog("prepareToPlay \(self)")
417 | options.prepareTime = CACurrentMediaTime()
:
437 | }
438 |
439 | public func shutdown() {
| `- note: main actor-isolated instance method 'shutdown()' cannot satisfy nonisolated requirement
440 | KSLog("shutdown \(self)")
441 | isReadyToPlay = false
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:514:27: warning: conformance of 'AVMediaPlayerTrack' to protocol 'MediaPlayerTrack' crosses into main actor-isolated code and can cause data races; this is an error in the Swift 6 language mode [#ConformanceIsolation]
512 | }
513 |
514 | class AVMediaPlayerTrack: MediaPlayerTrack {
| |- warning: conformance of 'AVMediaPlayerTrack' to protocol 'MediaPlayerTrack' crosses into main actor-isolated code and can cause data races; this is an error in the Swift 6 language mode [#ConformanceIsolation]
| |- note: isolate this conformance to the main actor with '@MainActor'
| `- note: turn data races into runtime errors with '@preconcurrency'
515 | let formatDescription: CMFormatDescription?
516 | let description: String
:
529 | var isPlayable: Bool
530 | @MainActor
531 | var isEnabled: Bool {
| `- note: main actor-isolated property 'isEnabled' cannot satisfy nonisolated requirement
532 | get {
533 | track.isEnabled
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:220:18: warning: call to main actor-isolated instance method 'observer(playerItem:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
218 | itemObservation = player.observe(\.currentItem) { [weak self] player, _ in
219 | guard let self else { return }
220 | self.observer(playerItem: player.currentItem)
| `- warning: call to main actor-isolated instance method 'observer(playerItem:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
221 | }
222 | }
:
324 | }
325 |
326 | private func observer(playerItem: AVPlayerItem?) {
| `- note: calls to instance method 'observer(playerItem:)' from outside of its actor context are implicitly asynchronous
327 | NotificationCenter.default.removeObserver(self, name: .AVPlayerItemDidPlayToEndTime, object: playerItem)
328 | NotificationCenter.default.removeObserver(self, name: .AVPlayerItemFailedToPlayToEndTime, object: playerItem)
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:313:22: warning: main actor-isolated property 'delegate' can not be referenced from a Sendable closure; this is an error in the Swift 6 language mode
126 | }
127 |
128 | public weak var delegate: MediaPlayerDelegate?
| `- note: property declared here
129 | public private(set) var duration: TimeInterval = 0
130 | public private(set) var fileSize: Double = 0
:
311 | loopCountObservation = playerLooper?.observe(\.loopCount) { [weak self] playerLooper, _ in
312 | guard let self else { return }
313 | self.delegate?.playBack(player: self, loopCount: playerLooper.loopCount)
| `- warning: main actor-isolated property 'delegate' can not be referenced from a Sendable closure; this is an error in the Swift 6 language mode
314 | }
315 | loopStatusObservation = playerLooper?.observe(\.status) { [weak self] playerLooper, _ in
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:313:32: warning: call to main actor-isolated instance method 'playBack(player:loopCount:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
311 | loopCountObservation = playerLooper?.observe(\.loopCount) { [weak self] playerLooper, _ in
312 | guard let self else { return }
313 | self.delegate?.playBack(player: self, loopCount: playerLooper.loopCount)
| `- warning: call to main actor-isolated instance method 'playBack(player:loopCount:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
314 | }
315 | loopStatusObservation = playerLooper?.observe(\.status) { [weak self] playerLooper, _ in
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/MediaPlayerProtocol.swift:113:10: note: calls to instance method 'playBack(player:loopCount:)' from outside of its actor context are implicitly asynchronous
111 | // 缓冲加载进度,0-100
112 | func changeBuffering(player: some MediaPlayerProtocol, progress: Int)
113 | func playBack(player: some MediaPlayerProtocol, loopCount: Int)
| `- note: calls to instance method 'playBack(player:loopCount:)' from outside of its actor context are implicitly asynchronous
114 | func finish(player: some MediaPlayerProtocol, error: Error?)
115 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:318:26: warning: main actor-isolated property 'error' can not be mutated from a Sendable closure; this is an error in the Swift 6 language mode
91 | private var loopStatusObservation: NSKeyValueObservation?
92 | private var mediaPlayerTracks = [AVMediaPlayerTrack]()
93 | private var error: Error? {
| `- note: mutation of this property is only permitted within the actor
94 | didSet {
95 | if let error {
:
316 | guard let self else { return }
317 | if playerLooper.status == .failed {
318 | self.error = playerLooper.error
| `- warning: main actor-isolated property 'error' can not be mutated from a Sendable closure; this is an error in the Swift 6 language mode
319 | }
320 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:356:93: warning: converting non-sendable function value to '@Sendable (AVPlayerItem, NSKeyValueObservedChange<Bool>) -> Void' may introduce data races
354 | }
355 | }
356 | bufferEmptyObservation = playerItem.observe(\.isPlaybackBufferEmpty, changeHandler: changeHandler)
| `- warning: converting non-sendable function value to '@Sendable (AVPlayerItem, NSKeyValueObservedChange<Bool>) -> Void' may introduce data races
357 | likelyToKeepUpObservation = playerItem.observe(\.isPlaybackLikelyToKeepUp, changeHandler: changeHandler)
358 | bufferFullObservation = playerItem.observe(\.isPlaybackBufferFull, changeHandler: changeHandler)
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:357:99: warning: converting non-sendable function value to '@Sendable (AVPlayerItem, NSKeyValueObservedChange<Bool>) -> Void' may introduce data races
355 | }
356 | bufferEmptyObservation = playerItem.observe(\.isPlaybackBufferEmpty, changeHandler: changeHandler)
357 | likelyToKeepUpObservation = playerItem.observe(\.isPlaybackLikelyToKeepUp, changeHandler: changeHandler)
| `- warning: converting non-sendable function value to '@Sendable (AVPlayerItem, NSKeyValueObservedChange<Bool>) -> Void' may introduce data races
358 | bufferFullObservation = playerItem.observe(\.isPlaybackBufferFull, changeHandler: changeHandler)
359 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:358:91: warning: converting non-sendable function value to '@Sendable (AVPlayerItem, NSKeyValueObservedChange<Bool>) -> Void' may introduce data races
356 | bufferEmptyObservation = playerItem.observe(\.isPlaybackBufferEmpty, changeHandler: changeHandler)
357 | likelyToKeepUpObservation = playerItem.observe(\.isPlaybackLikelyToKeepUp, changeHandler: changeHandler)
358 | bufferFullObservation = playerItem.observe(\.isPlaybackBufferFull, changeHandler: changeHandler)
| `- warning: converting non-sendable function value to '@Sendable (AVPlayerItem, NSKeyValueObservedChange<Bool>) -> Void' may introduce data races
359 | }
360 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:339:18: warning: call to main actor-isolated instance method 'updateStatus(item:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
246 | }
247 |
248 | private func updateStatus(item: AVPlayerItem) {
| `- note: calls to instance method 'updateStatus(item:)' from outside of its actor context are implicitly asynchronous
249 | if item.status == .readyToPlay {
250 | options.findTime = CACurrentMediaTime()
:
337 | statusObservation = playerItem.observe(\.status) { [weak self] item, _ in
338 | guard let self else { return }
339 | self.updateStatus(item: item)
| `- warning: call to main actor-isolated instance method 'updateStatus(item:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
340 | }
341 | loadedTimeRangesObservation = playerItem.observe(\.loadedTimeRanges) { [weak self] item, _ in
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:344:18: warning: call to main actor-isolated instance method 'updatePlayableDuration(item:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
272 | }
273 |
274 | private func updatePlayableDuration(item: AVPlayerItem) {
| `- note: calls to instance method 'updatePlayableDuration(item:)' from outside of its actor context are implicitly asynchronous
275 | let first = item.loadedTimeRanges.first { CMTimeRangeContainsTime($0.timeRangeValue, time: item.currentTime()) }
276 | if let first {
:
342 | guard let self else { return }
343 | // 计算缓冲进度
344 | self.updatePlayableDuration(item: item)
| `- warning: call to main actor-isolated instance method 'updatePlayableDuration(item:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
345 | }
346 |
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:411:13: warning: capture of 'completion' with non-sendable type '(Bool) -> Void' in a '@Sendable' closure [#SendableClosureCaptures]
409 | guard let self else { return }
410 | self.shouldSeekTo = 0
411 | completion(finished)
| |- warning: capture of 'completion' with non-sendable type '(Bool) -> Void' in a '@Sendable' closure [#SendableClosureCaptures]
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
412 | }
413 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:410:18: warning: main actor-isolated property 'shouldSeekTo' can not be mutated from a Sendable closure; this is an error in the Swift 6 language mode
80 | private let playerView = KSAVPlayerView()
81 | private var urlAsset: AVURLAsset
82 | private var shouldSeekTo = TimeInterval(0)
| `- note: mutation of this property is only permitted within the actor
83 | private var playerLooper: AVPlayerLooper?
84 | private var statusObservation: NSKeyValueObservation?
:
408 | [weak self] finished in
409 | guard let self else { return }
410 | self.shouldSeekTo = 0
| `- warning: main actor-isolated property 'shouldSeekTo' can not be mutated from a Sendable closure; this is an error in the Swift 6 language mode
411 | completion(finished)
412 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:555:39: warning: treating a forced downcast to 'CMFormatDescription' as optional will never produce 'nil'
553 | // swiftlint:disable force_cast
554 | if let first = track.assetTrack?.formatDescriptions.first {
555 | formatDescription = first as! CMFormatDescription
| | | `- note: use 'as?' to perform a conditional downcast to 'CMFormatDescription'
| | `- warning: treating a forced downcast to 'CMFormatDescription' as optional will never produce 'nil'
| `- note: add parentheses around the cast to silence this warning
556 | } else {
557 | formatDescription = nil
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:542:25: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
540 | init(track: AVPlayerItemTrack) {
541 | self.track = track
542 | trackID = track.assetTrack?.trackID ?? 0
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
543 | mediaType = track.assetTrack?.mediaType ?? .video
544 | name = track.assetTrack?.languageCode ?? ""
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:543:27: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
541 | self.track = track
542 | trackID = track.assetTrack?.trackID ?? 0
543 | mediaType = track.assetTrack?.mediaType ?? .video
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
544 | name = track.assetTrack?.languageCode ?? ""
545 | languageCode = track.assetTrack?.languageCode
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:544:22: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
542 | trackID = track.assetTrack?.trackID ?? 0
543 | mediaType = track.assetTrack?.mediaType ?? .video
544 | name = track.assetTrack?.languageCode ?? ""
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
545 | languageCode = track.assetTrack?.languageCode
546 | nominalFrameRate = track.assetTrack?.nominalFrameRate ?? 24.0
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:545:30: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
543 | mediaType = track.assetTrack?.mediaType ?? .video
544 | name = track.assetTrack?.languageCode ?? ""
545 | languageCode = track.assetTrack?.languageCode
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
546 | nominalFrameRate = track.assetTrack?.nominalFrameRate ?? 24.0
547 | bitRate = Int64(track.assetTrack?.estimatedDataRate ?? 0)
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:546:34: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
544 | name = track.assetTrack?.languageCode ?? ""
545 | languageCode = track.assetTrack?.languageCode
546 | nominalFrameRate = track.assetTrack?.nominalFrameRate ?? 24.0
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
547 | bitRate = Int64(track.assetTrack?.estimatedDataRate ?? 0)
548 | #if os(xrOS)
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:547:31: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
545 | languageCode = track.assetTrack?.languageCode
546 | nominalFrameRate = track.assetTrack?.nominalFrameRate ?? 24.0
547 | bitRate = Int64(track.assetTrack?.estimatedDataRate ?? 0)
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
548 | #if os(xrOS)
549 | isPlayable = false
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:551:28: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
549 | isPlayable = false
550 | #else
551 | isPlayable = track.assetTrack?.isPlayable ?? false
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
552 | #endif
553 | // swiftlint:disable force_cast
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:554:30: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
552 | #endif
553 | // swiftlint:disable force_cast
554 | if let first = track.assetTrack?.formatDescriptions.first {
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
555 | formatDescription = first as! CMFormatDescription
556 | } else {
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:586:17: warning: capture of 'handler' with non-sendable type '(CGImage?) -> Void' in a '@Sendable' closure [#SendableClosureCaptures]
584 | imageGenerator.generateCGImagesAsynchronously(forTimes: [NSValue(time: currentTime)]) { _, cgImage, _, _, _ in
585 | if let cgImage {
586 | handler(cgImage)
| |- warning: capture of 'handler' with non-sendable type '(CGImage?) -> Void' in a '@Sendable' closure [#SendableClosureCaptures]
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
587 | } else {
588 | handler(nil)
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:458:16: warning: static property 'firstPlayerType' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
456 |
457 | public extension KSOptions {
458 | static var firstPlayerType: MediaPlayerProtocol.Type = KSAVPlayer.self
| |- warning: static property 'firstPlayerType' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'firstPlayerType' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'firstPlayerType' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
459 | static var secondPlayerType: MediaPlayerProtocol.Type? = KSMEPlayer.self
460 | /// 最低缓存视频时间
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:459:16: warning: static property 'secondPlayerType' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
457 | public extension KSOptions {
458 | static var firstPlayerType: MediaPlayerProtocol.Type = KSAVPlayer.self
459 | static var secondPlayerType: MediaPlayerProtocol.Type? = KSMEPlayer.self
| |- warning: static property 'secondPlayerType' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'secondPlayerType' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'secondPlayerType' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
460 | /// 最低缓存视频时间
461 | static var preferredForwardBufferDuration = 3.0
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:461:16: warning: static property 'preferredForwardBufferDuration' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
459 | static var secondPlayerType: MediaPlayerProtocol.Type? = KSMEPlayer.self
460 | /// 最低缓存视频时间
461 | static var preferredForwardBufferDuration = 3.0
| |- warning: static property 'preferredForwardBufferDuration' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'preferredForwardBufferDuration' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'preferredForwardBufferDuration' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
462 | /// 最大缓存视频时间
463 | static var maxBufferDuration = 30.0
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:463:16: warning: static property 'maxBufferDuration' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
461 | static var preferredForwardBufferDuration = 3.0
462 | /// 最大缓存视频时间
463 | static var maxBufferDuration = 30.0
| |- warning: static property 'maxBufferDuration' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'maxBufferDuration' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'maxBufferDuration' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
464 | /// 是否开启秒开
465 | static var isSecondOpen = false
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:465:16: warning: static property 'isSecondOpen' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
463 | static var maxBufferDuration = 30.0
464 | /// 是否开启秒开
465 | static var isSecondOpen = false
| |- warning: static property 'isSecondOpen' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'isSecondOpen' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'isSecondOpen' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
466 | /// 开启精确seek
467 | static var isAccurateSeek = false
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:467:16: warning: static property 'isAccurateSeek' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
465 | static var isSecondOpen = false
466 | /// 开启精确seek
467 | static var isAccurateSeek = false
| |- warning: static property 'isAccurateSeek' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'isAccurateSeek' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'isAccurateSeek' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
468 | /// Applies to short videos only
469 | static var isLoopPlay = false
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:469:16: warning: static property 'isLoopPlay' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
467 | static var isAccurateSeek = false
468 | /// Applies to short videos only
469 | static var isLoopPlay = false
| |- warning: static property 'isLoopPlay' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'isLoopPlay' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'isLoopPlay' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
470 | /// 是否自动播放,默认true
471 | static var isAutoPlay = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:471:16: warning: static property 'isAutoPlay' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
469 | static var isLoopPlay = false
470 | /// 是否自动播放,默认true
471 | static var isAutoPlay = true
| |- warning: static property 'isAutoPlay' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'isAutoPlay' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'isAutoPlay' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
472 | /// seek完是否自动播放
473 | static var isSeekedAutoPlay = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:473:16: warning: static property 'isSeekedAutoPlay' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
471 | static var isAutoPlay = true
472 | /// seek完是否自动播放
473 | static var isSeekedAutoPlay = true
| |- warning: static property 'isSeekedAutoPlay' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'isSeekedAutoPlay' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'isSeekedAutoPlay' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
474 | static var hardwareDecode = true
475 | // 默认不用自研的硬解,因为有些视频的AVPacket的pts顺序是不对的,只有解码后的AVFrame里面的pts是对的。
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:474:16: warning: static property 'hardwareDecode' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
472 | /// seek完是否自动播放
473 | static var isSeekedAutoPlay = true
474 | static var hardwareDecode = true
| |- warning: static property 'hardwareDecode' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'hardwareDecode' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'hardwareDecode' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
475 | // 默认不用自研的硬解,因为有些视频的AVPacket的pts顺序是不对的,只有解码后的AVFrame里面的pts是对的。
476 | static var asynchronousDecompression = false
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:476:16: warning: static property 'asynchronousDecompression' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
474 | static var hardwareDecode = true
475 | // 默认不用自研的硬解,因为有些视频的AVPacket的pts顺序是不对的,只有解码后的AVFrame里面的pts是对的。
476 | static var asynchronousDecompression = false
| |- warning: static property 'asynchronousDecompression' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'asynchronousDecompression' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'asynchronousDecompression' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
477 | static var isPipPopViewController = false
478 | static var canStartPictureInPictureAutomaticallyFromInline = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:477:16: warning: static property 'isPipPopViewController' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
475 | // 默认不用自研的硬解,因为有些视频的AVPacket的pts顺序是不对的,只有解码后的AVFrame里面的pts是对的。
476 | static var asynchronousDecompression = false
477 | static var isPipPopViewController = false
| |- warning: static property 'isPipPopViewController' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'isPipPopViewController' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'isPipPopViewController' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
478 | static var canStartPictureInPictureAutomaticallyFromInline = true
479 | static var preferredFrame = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:478:16: warning: static property 'canStartPictureInPictureAutomaticallyFromInline' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
476 | static var asynchronousDecompression = false
477 | static var isPipPopViewController = false
478 | static var canStartPictureInPictureAutomaticallyFromInline = true
| |- warning: static property 'canStartPictureInPictureAutomaticallyFromInline' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'canStartPictureInPictureAutomaticallyFromInline' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'canStartPictureInPictureAutomaticallyFromInline' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
479 | static var preferredFrame = true
480 | static var useSystemHTTPProxy = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:479:16: warning: static property 'preferredFrame' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
477 | static var isPipPopViewController = false
478 | static var canStartPictureInPictureAutomaticallyFromInline = true
479 | static var preferredFrame = true
| |- warning: static property 'preferredFrame' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'preferredFrame' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'preferredFrame' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
480 | static var useSystemHTTPProxy = true
481 | /// 日志级别
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:480:16: warning: static property 'useSystemHTTPProxy' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
478 | static var canStartPictureInPictureAutomaticallyFromInline = true
479 | static var preferredFrame = true
480 | static var useSystemHTTPProxy = true
| |- warning: static property 'useSystemHTTPProxy' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'useSystemHTTPProxy' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'useSystemHTTPProxy' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
481 | /// 日志级别
482 | static var logLevel = LogLevel.warning
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:482:16: warning: static property 'logLevel' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
480 | static var useSystemHTTPProxy = true
481 | /// 日志级别
482 | static var logLevel = LogLevel.warning
| |- warning: static property 'logLevel' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'logLevel' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'logLevel' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
483 | static var logger: LogHandler = OSLog(lable: "KSPlayer")
484 | internal static func deviceCpuCount() -> Int {
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:483:16: warning: static property 'logger' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
481 | /// 日志级别
482 | static var logLevel = LogLevel.warning
483 | static var logger: LogHandler = OSLog(lable: "KSPlayer")
| |- warning: static property 'logger' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'logger' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'logger' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
484 | internal static func deviceCpuCount() -> Int {
485 | var ncpu = UInt(0)
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:317:21: warning: variable 'yadifMode' was never mutated; consider changing to 'let' constant
315 | asynchronousDecompression = false
316 | let yadif = hardwareDecode ? "yadif_videotoolbox" : "yadif"
317 | var yadifMode = KSOptions.yadifMode
| `- warning: variable 'yadifMode' was never mutated; consider changing to 'let' constant
318 | // if let assetTrack = assetTrack as? FFmpegAssetTrack {
319 | // if assetTrack.realFrameRate.num == 2 * assetTrack.avgFrameRate.num, assetTrack.realFrameRate.den == assetTrack.avgFrameRate.den {
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPictureInPictureController.swift:12:24: warning: static property 'pipController' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
10 | @available(tvOS 14.0, *)
11 | public class KSPictureInPictureController: AVPictureInPictureController {
12 | private static var pipController: KSPictureInPictureController?
| |- warning: static property 'pipController' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'pipController' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'pipController' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
13 | private var originalViewController: UIViewController?
14 | private var view: KSPlayerLayer?
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:84:35: warning: capture of 'self' with non-sendable type 'KSPlayerLayer?' in a '@Sendable' closure [#SendableClosureCaptures]
65 | }
66 |
67 | open class KSPlayerLayer: NSObject {
| `- note: class 'KSPlayerLayer' does not conform to the 'Sendable' protocol
68 | public weak var delegate: KSPlayerLayerDelegate?
69 | @Published
:
82 | // 一定要async才不会pip之后就暂停播放
83 | DispatchQueue.main.async { [weak self] in
84 | guard let self else { return }
| `- warning: capture of 'self' with non-sendable type 'KSPlayerLayer?' in a '@Sendable' closure [#SendableClosureCaptures]
85 | pipController.start(view: self)
86 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:85:25: warning: capture of 'pipController' with non-sendable type 'KSPictureInPictureController' in a '@Sendable' closure [#SendableClosureCaptures]
83 | DispatchQueue.main.async { [weak self] in
84 | guard let self else { return }
85 | pipController.start(view: self)
| `- warning: capture of 'pipController' with non-sendable type 'KSPictureInPictureController' in a '@Sendable' closure [#SendableClosureCaptures]
86 | }
87 | } else {
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPictureInPictureController.swift:11:14: note: class 'KSPictureInPictureController' does not conform to the 'Sendable' protocol
9 |
10 | @available(tvOS 14.0, *)
11 | public class KSPictureInPictureController: AVPictureInPictureController {
| `- note: class 'KSPictureInPictureController' does not conform to the 'Sendable' protocol
12 | private static var pipController: KSPictureInPictureController?
13 | private var originalViewController: UIViewController?
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:102:73: warning: main actor-isolated property 'superview' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
100 | runOnMainThread { [weak self] in
101 | guard let self else { return }
102 | if let oldView = oldValue.view, let superview = oldView.superview, let view = player.view {
| `- warning: main actor-isolated property 'superview' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
103 | #if canImport(UIKit)
104 | superview.insertSubview(view, belowSubview: oldView)
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSView.h:87:59: note: property declared here
85 |
86 | @property (nullable, readonly, unsafe_unretained) NSWindow *window;
87 | @property (nullable, readonly, unsafe_unretained) NSView *superview;
| `- note: property declared here
88 | @property (copy) NSArray<__kindof NSView *> *subviews;
89 | - (BOOL)isDescendantOf:(NSView *)view;
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:106:31: warning: call to main actor-isolated instance method 'addSubview(_:positioned:relativeTo:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
104 | superview.insertSubview(view, belowSubview: oldView)
105 | #else
106 | superview.addSubview(view, positioned: .below, relativeTo: oldView)
| `- warning: call to main actor-isolated instance method 'addSubview(_:positioned:relativeTo:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
107 | #endif
108 | view.translatesAutoresizingMaskIntoConstraints = false
AppKit.NSView.addSubview:2:22: note: calls to instance method 'addSubview(_:positioned:relativeTo:)' from outside of its actor context are implicitly asynchronous
1 | class NSView {
2 | @MainActor open func addSubview(_ view: NSView, positioned place: NSWindow.OrderingMode, relativeTo otherView: NSView?)}
| |- note: calls to instance method 'addSubview(_:positioned:relativeTo:)' from outside of its actor context are implicitly asynchronous
| `- note: main actor isolation inferred from inheritance from class 'NSResponder'
3 |
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:108:26: warning: main actor-isolated property 'translatesAutoresizingMaskIntoConstraints' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
106 | superview.addSubview(view, positioned: .below, relativeTo: oldView)
107 | #endif
108 | view.translatesAutoresizingMaskIntoConstraints = false
| `- warning: main actor-isolated property 'translatesAutoresizingMaskIntoConstraints' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
109 | NSLayoutConstraint.activate([
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:276:16: note: mutation of this property is only permitted within the actor
274 | /* by default, the autoresizing mask on a view gives rise to constraints that fully determine the view's position. To do anything interesting with constraints, you need to turn that off. IB will turn it off.
275 | */
276 | @property BOOL translatesAutoresizingMaskIntoConstraints API_AVAILABLE(macos(10.7));
| `- note: mutation of this property is only permitted within the actor
277 |
278 | /* constraint based layout engages lazily when someone tries to use it. If you do all of your constraint set up in -updateConstraints, you might never even receive updateConstraints if no one makes a constraint. To fix this chicken and egg problem, override this method to return YES if your view needs the window to use constraint based layout.
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:110:30: warning: main actor-isolated property 'topAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
108 | view.translatesAutoresizingMaskIntoConstraints = false
109 | NSLayoutConstraint.activate([
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
| `- warning: main actor-isolated property 'topAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:228:51: note: property declared here
226 | @property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
227 | @property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
228 | @property (readonly, strong) NSLayoutYAxisAnchor *topAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
229 | @property (readonly, strong) NSLayoutYAxisAnchor *bottomAnchor API_AVAILABLE(macos(10.11));
230 | @property (readonly, strong) NSLayoutDimension *widthAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:110:70: warning: main actor-isolated property 'topAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
108 | view.translatesAutoresizingMaskIntoConstraints = false
109 | NSLayoutConstraint.activate([
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
| `- warning: main actor-isolated property 'topAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:228:51: note: property declared here
226 | @property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
227 | @property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
228 | @property (readonly, strong) NSLayoutYAxisAnchor *topAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
229 | @property (readonly, strong) NSLayoutYAxisAnchor *bottomAnchor API_AVAILABLE(macos(10.11));
230 | @property (readonly, strong) NSLayoutDimension *widthAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:111:30: warning: main actor-isolated property 'leadingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
109 | NSLayoutConstraint.activate([
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
| `- warning: main actor-isolated property 'leadingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
113 | view.trailingAnchor.constraint(equalTo: superview.trailingAnchor),
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:224:51: note: property declared here
222 | See NSLayoutAnchor.h for more details.
223 | */
224 | @property (readonly, strong) NSLayoutXAxisAnchor *leadingAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
225 | @property (readonly, strong) NSLayoutXAxisAnchor *trailingAnchor API_AVAILABLE(macos(10.11));
226 | @property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:111:74: warning: main actor-isolated property 'leadingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
109 | NSLayoutConstraint.activate([
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
| `- warning: main actor-isolated property 'leadingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
113 | view.trailingAnchor.constraint(equalTo: superview.trailingAnchor),
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:224:51: note: property declared here
222 | See NSLayoutAnchor.h for more details.
223 | */
224 | @property (readonly, strong) NSLayoutXAxisAnchor *leadingAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
225 | @property (readonly, strong) NSLayoutXAxisAnchor *trailingAnchor API_AVAILABLE(macos(10.11));
226 | @property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:112:30: warning: main actor-isolated property 'bottomAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
| `- warning: main actor-isolated property 'bottomAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
113 | view.trailingAnchor.constraint(equalTo: superview.trailingAnchor),
114 | ])
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:229:51: note: property declared here
227 | @property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
228 | @property (readonly, strong) NSLayoutYAxisAnchor *topAnchor API_AVAILABLE(macos(10.11));
229 | @property (readonly, strong) NSLayoutYAxisAnchor *bottomAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
230 | @property (readonly, strong) NSLayoutDimension *widthAnchor API_AVAILABLE(macos(10.11));
231 | @property (readonly, strong) NSLayoutDimension *heightAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:112:73: warning: main actor-isolated property 'bottomAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
| `- warning: main actor-isolated property 'bottomAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
113 | view.trailingAnchor.constraint(equalTo: superview.trailingAnchor),
114 | ])
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:229:51: note: property declared here
227 | @property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
228 | @property (readonly, strong) NSLayoutYAxisAnchor *topAnchor API_AVAILABLE(macos(10.11));
229 | @property (readonly, strong) NSLayoutYAxisAnchor *bottomAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
230 | @property (readonly, strong) NSLayoutDimension *widthAnchor API_AVAILABLE(macos(10.11));
231 | @property (readonly, strong) NSLayoutDimension *heightAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:113:30: warning: main actor-isolated property 'trailingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
113 | view.trailingAnchor.constraint(equalTo: superview.trailingAnchor),
| `- warning: main actor-isolated property 'trailingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
114 | ])
115 | }
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:225:51: note: property declared here
223 | */
224 | @property (readonly, strong) NSLayoutXAxisAnchor *leadingAnchor API_AVAILABLE(macos(10.11));
225 | @property (readonly, strong) NSLayoutXAxisAnchor *trailingAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
226 | @property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
227 | @property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:113:75: warning: main actor-isolated property 'trailingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
113 | view.trailingAnchor.constraint(equalTo: superview.trailingAnchor),
| `- warning: main actor-isolated property 'trailingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
114 | ])
115 | }
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:225:51: note: property declared here
223 | */
224 | @property (readonly, strong) NSLayoutXAxisAnchor *leadingAnchor API_AVAILABLE(macos(10.11));
225 | @property (readonly, strong) NSLayoutXAxisAnchor *trailingAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
226 | @property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
227 | @property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:116:32: warning: call to main actor-isolated instance method 'removeFromSuperview()' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
114 | ])
115 | }
116 | oldValue.view?.removeFromSuperview()
| `- warning: call to main actor-isolated instance method 'removeFromSuperview()' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
117 | }
118 | player.playbackRate = oldValue.playbackRate
AppKit.NSView.removeFromSuperview:2:22: note: calls to instance method 'removeFromSuperview()' from outside of its actor context are implicitly asynchronous
1 | class NSView {
2 | @MainActor open func removeFromSuperview()}
| |- note: calls to instance method 'removeFromSuperview()' from outside of its actor context are implicitly asynchronous
| `- note: main actor isolation inferred from inheritance from class 'NSResponder'
3 |
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:176:19: warning: capture of 'self' with non-sendable type 'KSPlayerLayer?' in a '@Sendable' closure [#SendableClosureCaptures]
65 | }
66 |
67 | open class KSPlayerLayer: NSObject {
| `- note: class 'KSPlayerLayer' does not conform to the 'Sendable' protocol
68 | public weak var delegate: KSPlayerLayerDelegate?
69 | @Published
:
174 |
175 | private lazy var timer: Timer = .scheduledTimer(withTimeInterval: 0.1, repeats: true) { [weak self] _ in
176 | guard let self, self.player.isReadyToPlay else {
| `- warning: capture of 'self' with non-sendable type 'KSPlayerLayer?' in a '@Sendable' closure [#SendableClosureCaptures]
177 | return
178 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:179:24: warning: call to main actor-isolated instance method 'player(layer:currentTime:totalTime:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
60 | public protocol KSPlayerLayerDelegate: AnyObject {
61 | func player(layer: KSPlayerLayer, state: KSPlayerState)
62 | func player(layer: KSPlayerLayer, currentTime: TimeInterval, totalTime: TimeInterval)
| `- note: calls to instance method 'player(layer:currentTime:totalTime:)' from outside of its actor context are implicitly asynchronous
63 | func player(layer: KSPlayerLayer, finish error: Error?)
64 | func player(layer: KSPlayerLayer, bufferedCount: Int, consumeTime: TimeInterval)
:
177 | return
178 | }
179 | self.delegate?.player(layer: self, currentTime: self.player.currentPlaybackTime, totalTime: self.player.duration)
| `- warning: call to main actor-isolated instance method 'player(layer:currentTime:totalTime:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
180 | if self.player.playbackState == .playing, self.player.loadState == .playable, self.state == .buffering {
181 | // 一个兜底保护,正常不能走到这里
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:488:5: warning: non-'@objc' instance method declared in extension cannot be overridden; use 'public' instead; this will be an error in a future Swift language mode
486 |
487 | extension KSPlayerLayer {
488 | open func prepareToPlay() {
| `- warning: non-'@objc' instance method declared in extension cannot be overridden; use 'public' instead; this will be an error in a future Swift language mode
489 | state = .preparing
490 | startTime = CACurrentMediaTime()
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:169:36: warning: call to main actor-isolated instance method 'player(layer:state:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
59 | @MainActor
60 | public protocol KSPlayerLayerDelegate: AnyObject {
61 | func player(layer: KSPlayerLayer, state: KSPlayerState)
| `- note: calls to instance method 'player(layer:state:)' from outside of its actor context are implicitly asynchronous
62 | func player(layer: KSPlayerLayer, currentTime: TimeInterval, totalTime: TimeInterval)
63 | func player(layer: KSPlayerLayer, finish error: Error?)
:
167 | guard let self else { return }
168 | KSLog("playerStateDidChange - \(newValue)")
169 | self.delegate?.player(layer: self, state: newValue)
| `- warning: call to main actor-isolated instance method 'player(layer:state:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
170 | }
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:281:34: warning: main actor-isolated property 'isIdleTimerDisabled' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
279 | open func play() {
280 | runOnMainThread {
281 | UIApplication.shared.isIdleTimerDisabled = true
| `- warning: main actor-isolated property 'isIdleTimerDisabled' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
282 | }
283 | isAutoPlay = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/Core/AppKitExtend.swift:315:9: note: mutation of this property is only permitted within the actor
313 | }
314 |
315 | var isIdleTimerDisabled: Bool {
| `- note: mutation of this property is only permitted within the actor
316 | get {
317 | UIApplication.isIdleTimerDisabled
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:281:27: warning: main actor-isolated class property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
279 | open func play() {
280 | runOnMainThread {
281 | UIApplication.shared.isIdleTimerDisabled = true
| `- warning: main actor-isolated class property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
282 | }
283 | isAutoPlay = true
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:193:61: note: mutation of this class property is only permitted within the actor
191 | APPKIT_EXTERN __kindof NSApplication * _Null_unspecified NSApp NS_SWIFT_UI_ACTOR;
192 |
193 | @property (class, readonly, strong) __kindof NSApplication *sharedApplication;
| `- note: mutation of this class property is only permitted within the actor
194 | @property (nullable, weak) id<NSApplicationDelegate> delegate;
195 |
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:314:34: warning: main actor-isolated property 'isIdleTimerDisabled' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
312 | MPNowPlayingInfoCenter.default().playbackState = .paused
313 | runOnMainThread {
314 | UIApplication.shared.isIdleTimerDisabled = false
| `- warning: main actor-isolated property 'isIdleTimerDisabled' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
315 | }
316 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/Core/AppKitExtend.swift:315:9: note: mutation of this property is only permitted within the actor
313 | }
314 |
315 | var isIdleTimerDisabled: Bool {
| `- note: mutation of this property is only permitted within the actor
316 | get {
317 | UIApplication.isIdleTimerDisabled
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:314:27: warning: main actor-isolated class property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
312 | MPNowPlayingInfoCenter.default().playbackState = .paused
313 | runOnMainThread {
314 | UIApplication.shared.isIdleTimerDisabled = false
| `- warning: main actor-isolated class property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
315 | }
316 | }
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:193:61: note: mutation of this class property is only permitted within the actor
191 | APPKIT_EXTERN __kindof NSApplication * _Null_unspecified NSApp NS_SWIFT_UI_ACTOR;
192 |
193 | @property (class, readonly, strong) __kindof NSApplication *sharedApplication;
| `- note: mutation of this class property is only permitted within the actor
194 | @property (nullable, weak) id<NSApplicationDelegate> delegate;
195 |
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:328:34: warning: main actor-isolated property 'isIdleTimerDisabled' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
326 | MPNowPlayingInfoCenter.default().nowPlayingInfo = nil
327 | runOnMainThread {
328 | UIApplication.shared.isIdleTimerDisabled = false
| `- warning: main actor-isolated property 'isIdleTimerDisabled' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
329 | }
330 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/Core/AppKitExtend.swift:315:9: note: mutation of this property is only permitted within the actor
313 | }
314 |
315 | var isIdleTimerDisabled: Bool {
| `- note: mutation of this property is only permitted within the actor
316 | get {
317 | UIApplication.isIdleTimerDisabled
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:328:27: warning: main actor-isolated class property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
326 | MPNowPlayingInfoCenter.default().nowPlayingInfo = nil
327 | runOnMainThread {
328 | UIApplication.shared.isIdleTimerDisabled = false
| `- warning: main actor-isolated class property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
329 | }
330 | }
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:193:61: note: mutation of this class property is only permitted within the actor
191 | APPKIT_EXTERN __kindof NSApplication * _Null_unspecified NSApp NS_SWIFT_UI_ACTOR;
192 |
193 | @property (class, readonly, strong) __kindof NSApplication *sharedApplication;
| `- note: mutation of this class property is only permitted within the actor
194 | @property (nullable, weak) id<NSApplicationDelegate> delegate;
195 |
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:84:35: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
82 | // 一定要async才不会pip之后就暂停播放
83 | DispatchQueue.main.async { [weak self] in
84 | guard let self else { return }
| |- warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: task-isolated 'self' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
85 | pipController.start(view: self)
86 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:85:25: warning: sending 'pipController' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
83 | DispatchQueue.main.async { [weak self] in
84 | guard let self else { return }
85 | pipController.start(view: self)
| |- warning: sending 'pipController' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: task-isolated 'pipController' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
86 | }
87 | } else {
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:169:36: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
167 | guard let self else { return }
168 | KSLog("playerStateDidChange - \(newValue)")
169 | self.delegate?.player(layer: self, state: newValue)
| |- warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending task-isolated 'self' to main actor-isolated instance method 'player(layer:state:)' risks causing data races between main actor-isolated and task-isolated uses
170 | }
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:169:36: warning: sending 'newValue' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
167 | guard let self else { return }
168 | KSLog("playerStateDidChange - \(newValue)")
169 | self.delegate?.player(layer: self, state: newValue)
| |- warning: sending 'newValue' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending task-isolated 'newValue' to main actor-isolated instance method 'player(layer:state:)' risks causing data races between main actor-isolated and task-isolated uses
170 | }
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:169:36: warning: sending value of non-Sendable type 'any KSPlayerLayerDelegate' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
167 | guard let self else { return }
168 | KSLog("playerStateDidChange - \(newValue)")
169 | self.delegate?.player(layer: self, state: newValue)
| |- warning: sending value of non-Sendable type 'any KSPlayerLayerDelegate' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending task-isolated value of non-Sendable type 'any KSPlayerLayerDelegate' to main actor-isolated instance method 'player(layer:state:)' risks causing races in between task-isolated and main actor-isolated uses
170 | }
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:179:24: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
177 | return
178 | }
179 | self.delegate?.player(layer: self, currentTime: self.player.currentPlaybackTime, totalTime: self.player.duration)
| |- warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending 'self' to main actor-isolated instance method 'player(layer:currentTime:totalTime:)' risks causing data races between main actor-isolated and local nonisolated uses
180 | if self.player.playbackState == .playing, self.player.loadState == .playable, self.state == .buffering {
| `- note: access can happen concurrently
181 | // 一个兜底保护,正常不能走到这里
182 | self.state = .bufferFinished
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:179:24: warning: sending value of non-Sendable type 'any KSPlayerLayerDelegate' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
177 | return
178 | }
179 | self.delegate?.player(layer: self, currentTime: self.player.currentPlaybackTime, totalTime: self.player.duration)
| |- warning: sending value of non-Sendable type 'any KSPlayerLayerDelegate' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending value of non-Sendable type 'any KSPlayerLayerDelegate' to main actor-isolated instance method 'player(layer:currentTime:totalTime:)' risks causing data races between main actor-isolated and local nonisolated uses
180 | if self.player.playbackState == .playing, self.player.loadState == .playable, self.state == .buffering {
| `- note: access can happen concurrently
181 | // 一个兜底保护,正常不能走到这里
182 | self.state = .bufferFinished
[#ActorIsolatedCall]: <https://docs.swift.org/compiler/documentation/diagnostics/actor-isolated-call>
[#ConformanceIsolation]: <https://docs.swift.org/compiler/documentation/diagnostics/conformance-isolation>
[#MutableGlobalVariable]: <https://docs.swift.org/compiler/documentation/diagnostics/mutable-global-variable>
[#SendableClosureCaptures]: <https://docs.swift.org/compiler/documentation/diagnostics/sendable-closure-captures>
[#SendingRisksDataRace]: <https://docs.swift.org/compiler/documentation/diagnostics/sending-risks-data-race>
[91/91] Compiling KSPlayer MediaPlayerProtocol.swift
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:362:23: warning: conformance of 'KSAVPlayer' to protocol 'MediaPlayerProtocol' crosses into main actor-isolated code and can cause data races; this is an error in the Swift 6 language mode [#ConformanceIsolation]
109 |
110 | @available(tvOS 14.0, *)
111 | public var pipController: KSPictureInPictureController? {
| `- note: main actor-isolated property 'pipController' cannot satisfy nonisolated requirement
112 | _pipController as? KSPictureInPictureController
113 | }
114 |
115 | public var naturalSize: CGSize = .zero
116 | public let dynamicInfo: DynamicInfo? = nil
| `- note: main actor-isolated property 'dynamicInfo' cannot satisfy nonisolated requirement
117 | @available(macOS 12.0, iOS 15.0, tvOS 15.0, *)
118 | public var playbackCoordinator: AVPlaybackCoordinator {
| `- note: main actor-isolated property 'playbackCoordinator' cannot satisfy nonisolated requirement
119 | playerView.player.playbackCoordinator
120 | }
:
126 | }
127 |
128 | public weak var delegate: MediaPlayerDelegate?
| `- note: main actor-isolated property 'delegate' cannot satisfy nonisolated requirement
129 | public private(set) var duration: TimeInterval = 0
130 | public private(set) var fileSize: Double = 0
131 | public private(set) var playableTime: TimeInterval = 0
| `- note: main actor-isolated property 'playableTime' cannot satisfy nonisolated requirement
132 | public let chapters: [Chapter] = []
133 | public var playbackRate: Float = 1 {
| `- note: main actor-isolated property 'playbackRate' cannot satisfy nonisolated requirement
134 | didSet {
135 | if playbackState == .playing {
:
139 | }
140 |
141 | public var playbackVolume: Float = 1.0 {
| `- note: main actor-isolated property 'playbackVolume' cannot satisfy nonisolated requirement
142 | didSet {
143 | if player.volume != playbackVolume {
:
147 | }
148 |
149 | public private(set) var loadState = MediaLoadState.idle {
| `- note: main actor-isolated property 'loadState' cannot satisfy nonisolated requirement
150 | didSet {
151 | if loadState != oldValue {
:
158 | }
159 |
160 | public private(set) var playbackState = MediaPlaybackState.idle {
| `- note: main actor-isolated property 'playbackState' cannot satisfy nonisolated requirement
161 | didSet {
162 | if playbackState != oldValue {
:
169 | }
170 |
171 | public private(set) var isReadyToPlay = false {
| `- note: main actor-isolated property 'isReadyToPlay' cannot satisfy nonisolated requirement
172 | didSet {
173 | if isReadyToPlay != oldValue {
:
185 | public let isExternalPlaybackActive = false
186 | #else
187 | public var allowsExternalPlayback: Bool {
| `- note: main actor-isolated property 'allowsExternalPlayback' cannot satisfy nonisolated requirement
188 | get {
189 | player.allowsExternalPlayback
:
195 |
196 | #if os(macOS)
197 | public var usesExternalPlaybackWhileExternalScreenIsActive = false
| `- note: main actor-isolated property 'usesExternalPlaybackWhileExternalScreenIsActive' cannot satisfy nonisolated requirement
198 | #else
199 | public var usesExternalPlaybackWhileExternalScreenIsActive: Bool {
:
207 | #endif
208 |
209 | public var isExternalPlaybackActive: Bool {
| `- note: main actor-isolated property 'isExternalPlaybackActive' cannot satisfy nonisolated requirement
210 | player.isExternalPlaybackActive
211 | }
212 | #endif
213 |
214 | public required init(url: URL, options: KSOptions) {
| `- note: main actor-isolated initializer 'init(url:options:)' cannot satisfy nonisolated requirement
215 | KSOptions.setAudioSession()
216 | urlAsset = AVURLAsset(url: url, options: options.avOptions)
:
360 | }
361 |
362 | extension KSAVPlayer: MediaPlayerProtocol {
| | |- warning: conformance of 'KSAVPlayer' to protocol 'MediaPlayerProtocol' crosses into main actor-isolated code and can cause data races; this is an error in the Swift 6 language mode [#ConformanceIsolation]
| | |- note: isolate this conformance to the main actor with '@MainActor'
| | `- note: turn data races into runtime errors with '@preconcurrency'
| `- note: mark all declarations used in the conformance 'nonisolated'
363 | public var subtitleDataSouce: SubtitleDataSouce? { nil }
| `- note: main actor-isolated property 'subtitleDataSouce' cannot satisfy nonisolated requirement
364 | public var isPlaying: Bool { player.rate > 0 ? true : playbackState == .playing }
| `- note: main actor-isolated property 'isPlaying' cannot satisfy nonisolated requirement
365 | public var view: UIView? { playerView }
| `- note: main actor-isolated property 'view' cannot satisfy nonisolated requirement
366 | public var currentPlaybackTime: TimeInterval {
367 | get {
:
427 | }
428 |
429 | public func play() {
| `- note: main actor-isolated instance method 'play()' cannot satisfy nonisolated requirement
430 | KSLog("play \(self)")
431 | playbackState = .playing
432 | }
433 |
434 | public func pause() {
| `- note: main actor-isolated instance method 'pause()' cannot satisfy nonisolated requirement
435 | KSLog("pause \(self)")
436 | playbackState = .paused
:
446 | }
447 |
448 | public func replace(url: URL, options: KSOptions) {
| `- note: main actor-isolated instance method 'replace(url:options:)' cannot satisfy nonisolated requirement
449 | KSLog("replaceUrl \(self)")
450 | shutdown()
:
453 | }
454 |
455 | public var contentMode: UIViewContentMode {
| `- note: main actor-isolated property 'contentMode' cannot satisfy nonisolated requirement
456 | get {
457 | playerView.contentMode
:
462 | }
463 |
464 | public func enterBackground() {
| `- note: main actor-isolated instance method 'enterBackground()' cannot satisfy nonisolated requirement
465 | playerView.playerLayer.player = nil
466 | }
467 |
468 | public func enterForeground() {
| `- note: main actor-isolated instance method 'enterForeground()' cannot satisfy nonisolated requirement
469 | playerView.playerLayer.player = playerView.player
470 | }
471 |
472 | public var seekable: Bool {
| `- note: main actor-isolated property 'seekable' cannot satisfy nonisolated requirement
473 | !(player.currentItem?.seekableTimeRanges.isEmpty ?? true)
474 | }
475 |
476 | public var isMuted: Bool {
| `- note: main actor-isolated property 'isMuted' cannot satisfy nonisolated requirement
477 | get {
478 | player.isMuted
:
483 | }
484 |
485 | public func tracks(mediaType: AVFoundation.AVMediaType) -> [MediaPlayerTrack] {
| `- note: main actor-isolated instance method 'tracks(mediaType:)' cannot satisfy nonisolated requirement
486 | player.currentItem?.tracks.filter { $0.assetTrack?.mediaType == mediaType }.map { AVMediaPlayerTrack(track: $0) } ?? []
487 | }
488 |
489 | public func select(track: some MediaPlayerTrack) {
| `- note: main actor-isolated instance method 'select(track:)' cannot satisfy nonisolated requirement
490 | player.currentItem?.tracks.filter { $0.assetTrack?.mediaType == track.mediaType }.forEach { $0.isEnabled = false }
491 | track.isEnabled = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:362:1: warning: conformance of 'KSAVPlayer' to protocol 'MediaPlayback' crosses into main actor-isolated code and can cause data races; this is an error in the Swift 6 language mode [#ConformanceIsolation]
113 | }
114 |
115 | public var naturalSize: CGSize = .zero
| `- note: main actor-isolated property 'naturalSize' cannot satisfy nonisolated requirement
116 | public let dynamicInfo: DynamicInfo? = nil
117 | @available(macOS 12.0, iOS 15.0, tvOS 15.0, *)
:
127 |
128 | public weak var delegate: MediaPlayerDelegate?
129 | public private(set) var duration: TimeInterval = 0
| `- note: main actor-isolated property 'duration' cannot satisfy nonisolated requirement
130 | public private(set) var fileSize: Double = 0
| `- note: main actor-isolated property 'fileSize' cannot satisfy nonisolated requirement
131 | public private(set) var playableTime: TimeInterval = 0
132 | public let chapters: [Chapter] = []
| `- note: main actor-isolated property 'chapters' cannot satisfy nonisolated requirement
133 | public var playbackRate: Float = 1 {
134 | didSet {
:
360 | }
361 |
362 | extension KSAVPlayer: MediaPlayerProtocol {
| |- warning: conformance of 'KSAVPlayer' to protocol 'MediaPlayback' crosses into main actor-isolated code and can cause data races; this is an error in the Swift 6 language mode [#ConformanceIsolation]
| |- note: isolate this conformance to the main actor with '@MainActor'
| |- note: mark all declarations used in the conformance 'nonisolated'
| `- note: turn data races into runtime errors with '@preconcurrency'
363 | public var subtitleDataSouce: SubtitleDataSouce? { nil }
364 | public var isPlaying: Bool { player.rate > 0 ? true : playbackState == .playing }
365 | public var view: UIView? { playerView }
366 | public var currentPlaybackTime: TimeInterval {
| `- note: main actor-isolated property 'currentPlaybackTime' cannot satisfy nonisolated requirement
367 | get {
368 | if shouldSeekTo > 0 {
:
397 | }
398 |
399 | public func seek(time: TimeInterval, completion: @escaping ((Bool) -> Void)) {
| `- note: main actor-isolated instance method 'seek(time:completion:)' cannot satisfy nonisolated requirement
400 | let time = max(time, 0)
401 | shouldSeekTo = time
:
413 | }
414 |
415 | public func prepareToPlay() {
| `- note: main actor-isolated instance method 'prepareToPlay()' cannot satisfy nonisolated requirement
416 | KSLog("prepareToPlay \(self)")
417 | options.prepareTime = CACurrentMediaTime()
:
437 | }
438 |
439 | public func shutdown() {
| `- note: main actor-isolated instance method 'shutdown()' cannot satisfy nonisolated requirement
440 | KSLog("shutdown \(self)")
441 | isReadyToPlay = false
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:514:27: warning: conformance of 'AVMediaPlayerTrack' to protocol 'MediaPlayerTrack' crosses into main actor-isolated code and can cause data races; this is an error in the Swift 6 language mode [#ConformanceIsolation]
512 | }
513 |
514 | class AVMediaPlayerTrack: MediaPlayerTrack {
| |- warning: conformance of 'AVMediaPlayerTrack' to protocol 'MediaPlayerTrack' crosses into main actor-isolated code and can cause data races; this is an error in the Swift 6 language mode [#ConformanceIsolation]
| |- note: isolate this conformance to the main actor with '@MainActor'
| `- note: turn data races into runtime errors with '@preconcurrency'
515 | let formatDescription: CMFormatDescription?
516 | let description: String
:
529 | var isPlayable: Bool
530 | @MainActor
531 | var isEnabled: Bool {
| `- note: main actor-isolated property 'isEnabled' cannot satisfy nonisolated requirement
532 | get {
533 | track.isEnabled
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:220:18: warning: call to main actor-isolated instance method 'observer(playerItem:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
218 | itemObservation = player.observe(\.currentItem) { [weak self] player, _ in
219 | guard let self else { return }
220 | self.observer(playerItem: player.currentItem)
| `- warning: call to main actor-isolated instance method 'observer(playerItem:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
221 | }
222 | }
:
324 | }
325 |
326 | private func observer(playerItem: AVPlayerItem?) {
| `- note: calls to instance method 'observer(playerItem:)' from outside of its actor context are implicitly asynchronous
327 | NotificationCenter.default.removeObserver(self, name: .AVPlayerItemDidPlayToEndTime, object: playerItem)
328 | NotificationCenter.default.removeObserver(self, name: .AVPlayerItemFailedToPlayToEndTime, object: playerItem)
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:313:22: warning: main actor-isolated property 'delegate' can not be referenced from a Sendable closure; this is an error in the Swift 6 language mode
126 | }
127 |
128 | public weak var delegate: MediaPlayerDelegate?
| `- note: property declared here
129 | public private(set) var duration: TimeInterval = 0
130 | public private(set) var fileSize: Double = 0
:
311 | loopCountObservation = playerLooper?.observe(\.loopCount) { [weak self] playerLooper, _ in
312 | guard let self else { return }
313 | self.delegate?.playBack(player: self, loopCount: playerLooper.loopCount)
| `- warning: main actor-isolated property 'delegate' can not be referenced from a Sendable closure; this is an error in the Swift 6 language mode
314 | }
315 | loopStatusObservation = playerLooper?.observe(\.status) { [weak self] playerLooper, _ in
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:313:32: warning: call to main actor-isolated instance method 'playBack(player:loopCount:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
311 | loopCountObservation = playerLooper?.observe(\.loopCount) { [weak self] playerLooper, _ in
312 | guard let self else { return }
313 | self.delegate?.playBack(player: self, loopCount: playerLooper.loopCount)
| `- warning: call to main actor-isolated instance method 'playBack(player:loopCount:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
314 | }
315 | loopStatusObservation = playerLooper?.observe(\.status) { [weak self] playerLooper, _ in
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/MediaPlayerProtocol.swift:113:10: note: calls to instance method 'playBack(player:loopCount:)' from outside of its actor context are implicitly asynchronous
111 | // 缓冲加载进度,0-100
112 | func changeBuffering(player: some MediaPlayerProtocol, progress: Int)
113 | func playBack(player: some MediaPlayerProtocol, loopCount: Int)
| `- note: calls to instance method 'playBack(player:loopCount:)' from outside of its actor context are implicitly asynchronous
114 | func finish(player: some MediaPlayerProtocol, error: Error?)
115 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:318:26: warning: main actor-isolated property 'error' can not be mutated from a Sendable closure; this is an error in the Swift 6 language mode
91 | private var loopStatusObservation: NSKeyValueObservation?
92 | private var mediaPlayerTracks = [AVMediaPlayerTrack]()
93 | private var error: Error? {
| `- note: mutation of this property is only permitted within the actor
94 | didSet {
95 | if let error {
:
316 | guard let self else { return }
317 | if playerLooper.status == .failed {
318 | self.error = playerLooper.error
| `- warning: main actor-isolated property 'error' can not be mutated from a Sendable closure; this is an error in the Swift 6 language mode
319 | }
320 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:356:93: warning: converting non-sendable function value to '@Sendable (AVPlayerItem, NSKeyValueObservedChange<Bool>) -> Void' may introduce data races
354 | }
355 | }
356 | bufferEmptyObservation = playerItem.observe(\.isPlaybackBufferEmpty, changeHandler: changeHandler)
| `- warning: converting non-sendable function value to '@Sendable (AVPlayerItem, NSKeyValueObservedChange<Bool>) -> Void' may introduce data races
357 | likelyToKeepUpObservation = playerItem.observe(\.isPlaybackLikelyToKeepUp, changeHandler: changeHandler)
358 | bufferFullObservation = playerItem.observe(\.isPlaybackBufferFull, changeHandler: changeHandler)
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:357:99: warning: converting non-sendable function value to '@Sendable (AVPlayerItem, NSKeyValueObservedChange<Bool>) -> Void' may introduce data races
355 | }
356 | bufferEmptyObservation = playerItem.observe(\.isPlaybackBufferEmpty, changeHandler: changeHandler)
357 | likelyToKeepUpObservation = playerItem.observe(\.isPlaybackLikelyToKeepUp, changeHandler: changeHandler)
| `- warning: converting non-sendable function value to '@Sendable (AVPlayerItem, NSKeyValueObservedChange<Bool>) -> Void' may introduce data races
358 | bufferFullObservation = playerItem.observe(\.isPlaybackBufferFull, changeHandler: changeHandler)
359 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:358:91: warning: converting non-sendable function value to '@Sendable (AVPlayerItem, NSKeyValueObservedChange<Bool>) -> Void' may introduce data races
356 | bufferEmptyObservation = playerItem.observe(\.isPlaybackBufferEmpty, changeHandler: changeHandler)
357 | likelyToKeepUpObservation = playerItem.observe(\.isPlaybackLikelyToKeepUp, changeHandler: changeHandler)
358 | bufferFullObservation = playerItem.observe(\.isPlaybackBufferFull, changeHandler: changeHandler)
| `- warning: converting non-sendable function value to '@Sendable (AVPlayerItem, NSKeyValueObservedChange<Bool>) -> Void' may introduce data races
359 | }
360 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:339:18: warning: call to main actor-isolated instance method 'updateStatus(item:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
246 | }
247 |
248 | private func updateStatus(item: AVPlayerItem) {
| `- note: calls to instance method 'updateStatus(item:)' from outside of its actor context are implicitly asynchronous
249 | if item.status == .readyToPlay {
250 | options.findTime = CACurrentMediaTime()
:
337 | statusObservation = playerItem.observe(\.status) { [weak self] item, _ in
338 | guard let self else { return }
339 | self.updateStatus(item: item)
| `- warning: call to main actor-isolated instance method 'updateStatus(item:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
340 | }
341 | loadedTimeRangesObservation = playerItem.observe(\.loadedTimeRanges) { [weak self] item, _ in
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:344:18: warning: call to main actor-isolated instance method 'updatePlayableDuration(item:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
272 | }
273 |
274 | private func updatePlayableDuration(item: AVPlayerItem) {
| `- note: calls to instance method 'updatePlayableDuration(item:)' from outside of its actor context are implicitly asynchronous
275 | let first = item.loadedTimeRanges.first { CMTimeRangeContainsTime($0.timeRangeValue, time: item.currentTime()) }
276 | if let first {
:
342 | guard let self else { return }
343 | // 计算缓冲进度
344 | self.updatePlayableDuration(item: item)
| `- warning: call to main actor-isolated instance method 'updatePlayableDuration(item:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
345 | }
346 |
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:411:13: warning: capture of 'completion' with non-sendable type '(Bool) -> Void' in a '@Sendable' closure [#SendableClosureCaptures]
409 | guard let self else { return }
410 | self.shouldSeekTo = 0
411 | completion(finished)
| |- warning: capture of 'completion' with non-sendable type '(Bool) -> Void' in a '@Sendable' closure [#SendableClosureCaptures]
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
412 | }
413 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:410:18: warning: main actor-isolated property 'shouldSeekTo' can not be mutated from a Sendable closure; this is an error in the Swift 6 language mode
80 | private let playerView = KSAVPlayerView()
81 | private var urlAsset: AVURLAsset
82 | private var shouldSeekTo = TimeInterval(0)
| `- note: mutation of this property is only permitted within the actor
83 | private var playerLooper: AVPlayerLooper?
84 | private var statusObservation: NSKeyValueObservation?
:
408 | [weak self] finished in
409 | guard let self else { return }
410 | self.shouldSeekTo = 0
| `- warning: main actor-isolated property 'shouldSeekTo' can not be mutated from a Sendable closure; this is an error in the Swift 6 language mode
411 | completion(finished)
412 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:555:39: warning: treating a forced downcast to 'CMFormatDescription' as optional will never produce 'nil'
553 | // swiftlint:disable force_cast
554 | if let first = track.assetTrack?.formatDescriptions.first {
555 | formatDescription = first as! CMFormatDescription
| | | `- note: use 'as?' to perform a conditional downcast to 'CMFormatDescription'
| | `- warning: treating a forced downcast to 'CMFormatDescription' as optional will never produce 'nil'
| `- note: add parentheses around the cast to silence this warning
556 | } else {
557 | formatDescription = nil
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:542:25: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
540 | init(track: AVPlayerItemTrack) {
541 | self.track = track
542 | trackID = track.assetTrack?.trackID ?? 0
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
543 | mediaType = track.assetTrack?.mediaType ?? .video
544 | name = track.assetTrack?.languageCode ?? ""
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:543:27: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
541 | self.track = track
542 | trackID = track.assetTrack?.trackID ?? 0
543 | mediaType = track.assetTrack?.mediaType ?? .video
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
544 | name = track.assetTrack?.languageCode ?? ""
545 | languageCode = track.assetTrack?.languageCode
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:544:22: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
542 | trackID = track.assetTrack?.trackID ?? 0
543 | mediaType = track.assetTrack?.mediaType ?? .video
544 | name = track.assetTrack?.languageCode ?? ""
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
545 | languageCode = track.assetTrack?.languageCode
546 | nominalFrameRate = track.assetTrack?.nominalFrameRate ?? 24.0
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:545:30: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
543 | mediaType = track.assetTrack?.mediaType ?? .video
544 | name = track.assetTrack?.languageCode ?? ""
545 | languageCode = track.assetTrack?.languageCode
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
546 | nominalFrameRate = track.assetTrack?.nominalFrameRate ?? 24.0
547 | bitRate = Int64(track.assetTrack?.estimatedDataRate ?? 0)
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:546:34: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
544 | name = track.assetTrack?.languageCode ?? ""
545 | languageCode = track.assetTrack?.languageCode
546 | nominalFrameRate = track.assetTrack?.nominalFrameRate ?? 24.0
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
547 | bitRate = Int64(track.assetTrack?.estimatedDataRate ?? 0)
548 | #if os(xrOS)
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:547:31: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
545 | languageCode = track.assetTrack?.languageCode
546 | nominalFrameRate = track.assetTrack?.nominalFrameRate ?? 24.0
547 | bitRate = Int64(track.assetTrack?.estimatedDataRate ?? 0)
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
548 | #if os(xrOS)
549 | isPlayable = false
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:551:28: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
549 | isPlayable = false
550 | #else
551 | isPlayable = track.assetTrack?.isPlayable ?? false
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
552 | #endif
553 | // swiftlint:disable force_cast
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:554:30: warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
552 | #endif
553 | // swiftlint:disable force_cast
554 | if let first = track.assetTrack?.formatDescriptions.first {
| `- warning: main actor-isolated property 'assetTrack' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
555 | formatDescription = first as! CMFormatDescription
556 | } else {
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h:45:57: note: property declared here
43 | notification queue. By default, this queue is the main queue.
44 | */
45 | @property (nonatomic, readonly, nullable) AVAssetTrack *assetTrack;
| `- note: property declared here
46 |
47 | /*!
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSAVPlayer.swift:586:17: warning: capture of 'handler' with non-sendable type '(CGImage?) -> Void' in a '@Sendable' closure [#SendableClosureCaptures]
584 | imageGenerator.generateCGImagesAsynchronously(forTimes: [NSValue(time: currentTime)]) { _, cgImage, _, _, _ in
585 | if let cgImage {
586 | handler(cgImage)
| |- warning: capture of 'handler' with non-sendable type '(CGImage?) -> Void' in a '@Sendable' closure [#SendableClosureCaptures]
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
587 | } else {
588 | handler(nil)
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:458:16: warning: static property 'firstPlayerType' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
456 |
457 | public extension KSOptions {
458 | static var firstPlayerType: MediaPlayerProtocol.Type = KSAVPlayer.self
| |- warning: static property 'firstPlayerType' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'firstPlayerType' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'firstPlayerType' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
459 | static var secondPlayerType: MediaPlayerProtocol.Type? = KSMEPlayer.self
460 | /// 最低缓存视频时间
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:459:16: warning: static property 'secondPlayerType' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
457 | public extension KSOptions {
458 | static var firstPlayerType: MediaPlayerProtocol.Type = KSAVPlayer.self
459 | static var secondPlayerType: MediaPlayerProtocol.Type? = KSMEPlayer.self
| |- warning: static property 'secondPlayerType' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'secondPlayerType' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'secondPlayerType' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
460 | /// 最低缓存视频时间
461 | static var preferredForwardBufferDuration = 3.0
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:461:16: warning: static property 'preferredForwardBufferDuration' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
459 | static var secondPlayerType: MediaPlayerProtocol.Type? = KSMEPlayer.self
460 | /// 最低缓存视频时间
461 | static var preferredForwardBufferDuration = 3.0
| |- warning: static property 'preferredForwardBufferDuration' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'preferredForwardBufferDuration' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'preferredForwardBufferDuration' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
462 | /// 最大缓存视频时间
463 | static var maxBufferDuration = 30.0
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:463:16: warning: static property 'maxBufferDuration' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
461 | static var preferredForwardBufferDuration = 3.0
462 | /// 最大缓存视频时间
463 | static var maxBufferDuration = 30.0
| |- warning: static property 'maxBufferDuration' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'maxBufferDuration' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'maxBufferDuration' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
464 | /// 是否开启秒开
465 | static var isSecondOpen = false
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:465:16: warning: static property 'isSecondOpen' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
463 | static var maxBufferDuration = 30.0
464 | /// 是否开启秒开
465 | static var isSecondOpen = false
| |- warning: static property 'isSecondOpen' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'isSecondOpen' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'isSecondOpen' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
466 | /// 开启精确seek
467 | static var isAccurateSeek = false
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:467:16: warning: static property 'isAccurateSeek' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
465 | static var isSecondOpen = false
466 | /// 开启精确seek
467 | static var isAccurateSeek = false
| |- warning: static property 'isAccurateSeek' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'isAccurateSeek' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'isAccurateSeek' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
468 | /// Applies to short videos only
469 | static var isLoopPlay = false
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:469:16: warning: static property 'isLoopPlay' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
467 | static var isAccurateSeek = false
468 | /// Applies to short videos only
469 | static var isLoopPlay = false
| |- warning: static property 'isLoopPlay' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'isLoopPlay' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'isLoopPlay' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
470 | /// 是否自动播放,默认true
471 | static var isAutoPlay = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:471:16: warning: static property 'isAutoPlay' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
469 | static var isLoopPlay = false
470 | /// 是否自动播放,默认true
471 | static var isAutoPlay = true
| |- warning: static property 'isAutoPlay' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'isAutoPlay' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'isAutoPlay' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
472 | /// seek完是否自动播放
473 | static var isSeekedAutoPlay = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:473:16: warning: static property 'isSeekedAutoPlay' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
471 | static var isAutoPlay = true
472 | /// seek完是否自动播放
473 | static var isSeekedAutoPlay = true
| |- warning: static property 'isSeekedAutoPlay' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'isSeekedAutoPlay' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'isSeekedAutoPlay' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
474 | static var hardwareDecode = true
475 | // 默认不用自研的硬解,因为有些视频的AVPacket的pts顺序是不对的,只有解码后的AVFrame里面的pts是对的。
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:474:16: warning: static property 'hardwareDecode' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
472 | /// seek完是否自动播放
473 | static var isSeekedAutoPlay = true
474 | static var hardwareDecode = true
| |- warning: static property 'hardwareDecode' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'hardwareDecode' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'hardwareDecode' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
475 | // 默认不用自研的硬解,因为有些视频的AVPacket的pts顺序是不对的,只有解码后的AVFrame里面的pts是对的。
476 | static var asynchronousDecompression = false
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:476:16: warning: static property 'asynchronousDecompression' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
474 | static var hardwareDecode = true
475 | // 默认不用自研的硬解,因为有些视频的AVPacket的pts顺序是不对的,只有解码后的AVFrame里面的pts是对的。
476 | static var asynchronousDecompression = false
| |- warning: static property 'asynchronousDecompression' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'asynchronousDecompression' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'asynchronousDecompression' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
477 | static var isPipPopViewController = false
478 | static var canStartPictureInPictureAutomaticallyFromInline = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:477:16: warning: static property 'isPipPopViewController' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
475 | // 默认不用自研的硬解,因为有些视频的AVPacket的pts顺序是不对的,只有解码后的AVFrame里面的pts是对的。
476 | static var asynchronousDecompression = false
477 | static var isPipPopViewController = false
| |- warning: static property 'isPipPopViewController' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'isPipPopViewController' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'isPipPopViewController' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
478 | static var canStartPictureInPictureAutomaticallyFromInline = true
479 | static var preferredFrame = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:478:16: warning: static property 'canStartPictureInPictureAutomaticallyFromInline' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
476 | static var asynchronousDecompression = false
477 | static var isPipPopViewController = false
478 | static var canStartPictureInPictureAutomaticallyFromInline = true
| |- warning: static property 'canStartPictureInPictureAutomaticallyFromInline' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'canStartPictureInPictureAutomaticallyFromInline' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'canStartPictureInPictureAutomaticallyFromInline' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
479 | static var preferredFrame = true
480 | static var useSystemHTTPProxy = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:479:16: warning: static property 'preferredFrame' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
477 | static var isPipPopViewController = false
478 | static var canStartPictureInPictureAutomaticallyFromInline = true
479 | static var preferredFrame = true
| |- warning: static property 'preferredFrame' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'preferredFrame' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'preferredFrame' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
480 | static var useSystemHTTPProxy = true
481 | /// 日志级别
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:480:16: warning: static property 'useSystemHTTPProxy' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
478 | static var canStartPictureInPictureAutomaticallyFromInline = true
479 | static var preferredFrame = true
480 | static var useSystemHTTPProxy = true
| |- warning: static property 'useSystemHTTPProxy' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'useSystemHTTPProxy' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'useSystemHTTPProxy' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
481 | /// 日志级别
482 | static var logLevel = LogLevel.warning
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:482:16: warning: static property 'logLevel' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
480 | static var useSystemHTTPProxy = true
481 | /// 日志级别
482 | static var logLevel = LogLevel.warning
| |- warning: static property 'logLevel' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'logLevel' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'logLevel' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
483 | static var logger: LogHandler = OSLog(lable: "KSPlayer")
484 | internal static func deviceCpuCount() -> Int {
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:483:16: warning: static property 'logger' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
481 | /// 日志级别
482 | static var logLevel = LogLevel.warning
483 | static var logger: LogHandler = OSLog(lable: "KSPlayer")
| |- warning: static property 'logger' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'logger' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'logger' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
484 | internal static func deviceCpuCount() -> Int {
485 | var ncpu = UInt(0)
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSOptions.swift:317:21: warning: variable 'yadifMode' was never mutated; consider changing to 'let' constant
315 | asynchronousDecompression = false
316 | let yadif = hardwareDecode ? "yadif_videotoolbox" : "yadif"
317 | var yadifMode = KSOptions.yadifMode
| `- warning: variable 'yadifMode' was never mutated; consider changing to 'let' constant
318 | // if let assetTrack = assetTrack as? FFmpegAssetTrack {
319 | // if assetTrack.realFrameRate.num == 2 * assetTrack.avgFrameRate.num, assetTrack.realFrameRate.den == assetTrack.avgFrameRate.den {
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPictureInPictureController.swift:12:24: warning: static property 'pipController' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
10 | @available(tvOS 14.0, *)
11 | public class KSPictureInPictureController: AVPictureInPictureController {
12 | private static var pipController: KSPictureInPictureController?
| |- warning: static property 'pipController' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode [#MutableGlobalVariable]
| |- note: convert 'pipController' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'pipController' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
13 | private var originalViewController: UIViewController?
14 | private var view: KSPlayerLayer?
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:84:35: warning: capture of 'self' with non-sendable type 'KSPlayerLayer?' in a '@Sendable' closure [#SendableClosureCaptures]
65 | }
66 |
67 | open class KSPlayerLayer: NSObject {
| `- note: class 'KSPlayerLayer' does not conform to the 'Sendable' protocol
68 | public weak var delegate: KSPlayerLayerDelegate?
69 | @Published
:
82 | // 一定要async才不会pip之后就暂停播放
83 | DispatchQueue.main.async { [weak self] in
84 | guard let self else { return }
| `- warning: capture of 'self' with non-sendable type 'KSPlayerLayer?' in a '@Sendable' closure [#SendableClosureCaptures]
85 | pipController.start(view: self)
86 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:85:25: warning: capture of 'pipController' with non-sendable type 'KSPictureInPictureController' in a '@Sendable' closure [#SendableClosureCaptures]
83 | DispatchQueue.main.async { [weak self] in
84 | guard let self else { return }
85 | pipController.start(view: self)
| `- warning: capture of 'pipController' with non-sendable type 'KSPictureInPictureController' in a '@Sendable' closure [#SendableClosureCaptures]
86 | }
87 | } else {
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPictureInPictureController.swift:11:14: note: class 'KSPictureInPictureController' does not conform to the 'Sendable' protocol
9 |
10 | @available(tvOS 14.0, *)
11 | public class KSPictureInPictureController: AVPictureInPictureController {
| `- note: class 'KSPictureInPictureController' does not conform to the 'Sendable' protocol
12 | private static var pipController: KSPictureInPictureController?
13 | private var originalViewController: UIViewController?
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:102:73: warning: main actor-isolated property 'superview' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
100 | runOnMainThread { [weak self] in
101 | guard let self else { return }
102 | if let oldView = oldValue.view, let superview = oldView.superview, let view = player.view {
| `- warning: main actor-isolated property 'superview' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
103 | #if canImport(UIKit)
104 | superview.insertSubview(view, belowSubview: oldView)
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSView.h:87:59: note: property declared here
85 |
86 | @property (nullable, readonly, unsafe_unretained) NSWindow *window;
87 | @property (nullable, readonly, unsafe_unretained) NSView *superview;
| `- note: property declared here
88 | @property (copy) NSArray<__kindof NSView *> *subviews;
89 | - (BOOL)isDescendantOf:(NSView *)view;
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:106:31: warning: call to main actor-isolated instance method 'addSubview(_:positioned:relativeTo:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
104 | superview.insertSubview(view, belowSubview: oldView)
105 | #else
106 | superview.addSubview(view, positioned: .below, relativeTo: oldView)
| `- warning: call to main actor-isolated instance method 'addSubview(_:positioned:relativeTo:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
107 | #endif
108 | view.translatesAutoresizingMaskIntoConstraints = false
AppKit.NSView.addSubview:2:22: note: calls to instance method 'addSubview(_:positioned:relativeTo:)' from outside of its actor context are implicitly asynchronous
1 | class NSView {
2 | @MainActor open func addSubview(_ view: NSView, positioned place: NSWindow.OrderingMode, relativeTo otherView: NSView?)}
| |- note: calls to instance method 'addSubview(_:positioned:relativeTo:)' from outside of its actor context are implicitly asynchronous
| `- note: main actor isolation inferred from inheritance from class 'NSResponder'
3 |
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:108:26: warning: main actor-isolated property 'translatesAutoresizingMaskIntoConstraints' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
106 | superview.addSubview(view, positioned: .below, relativeTo: oldView)
107 | #endif
108 | view.translatesAutoresizingMaskIntoConstraints = false
| `- warning: main actor-isolated property 'translatesAutoresizingMaskIntoConstraints' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
109 | NSLayoutConstraint.activate([
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:276:16: note: mutation of this property is only permitted within the actor
274 | /* by default, the autoresizing mask on a view gives rise to constraints that fully determine the view's position. To do anything interesting with constraints, you need to turn that off. IB will turn it off.
275 | */
276 | @property BOOL translatesAutoresizingMaskIntoConstraints API_AVAILABLE(macos(10.7));
| `- note: mutation of this property is only permitted within the actor
277 |
278 | /* constraint based layout engages lazily when someone tries to use it. If you do all of your constraint set up in -updateConstraints, you might never even receive updateConstraints if no one makes a constraint. To fix this chicken and egg problem, override this method to return YES if your view needs the window to use constraint based layout.
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:110:30: warning: main actor-isolated property 'topAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
108 | view.translatesAutoresizingMaskIntoConstraints = false
109 | NSLayoutConstraint.activate([
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
| `- warning: main actor-isolated property 'topAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:228:51: note: property declared here
226 | @property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
227 | @property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
228 | @property (readonly, strong) NSLayoutYAxisAnchor *topAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
229 | @property (readonly, strong) NSLayoutYAxisAnchor *bottomAnchor API_AVAILABLE(macos(10.11));
230 | @property (readonly, strong) NSLayoutDimension *widthAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:110:70: warning: main actor-isolated property 'topAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
108 | view.translatesAutoresizingMaskIntoConstraints = false
109 | NSLayoutConstraint.activate([
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
| `- warning: main actor-isolated property 'topAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:228:51: note: property declared here
226 | @property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
227 | @property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
228 | @property (readonly, strong) NSLayoutYAxisAnchor *topAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
229 | @property (readonly, strong) NSLayoutYAxisAnchor *bottomAnchor API_AVAILABLE(macos(10.11));
230 | @property (readonly, strong) NSLayoutDimension *widthAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:111:30: warning: main actor-isolated property 'leadingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
109 | NSLayoutConstraint.activate([
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
| `- warning: main actor-isolated property 'leadingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
113 | view.trailingAnchor.constraint(equalTo: superview.trailingAnchor),
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:224:51: note: property declared here
222 | See NSLayoutAnchor.h for more details.
223 | */
224 | @property (readonly, strong) NSLayoutXAxisAnchor *leadingAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
225 | @property (readonly, strong) NSLayoutXAxisAnchor *trailingAnchor API_AVAILABLE(macos(10.11));
226 | @property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:111:74: warning: main actor-isolated property 'leadingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
109 | NSLayoutConstraint.activate([
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
| `- warning: main actor-isolated property 'leadingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
113 | view.trailingAnchor.constraint(equalTo: superview.trailingAnchor),
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:224:51: note: property declared here
222 | See NSLayoutAnchor.h for more details.
223 | */
224 | @property (readonly, strong) NSLayoutXAxisAnchor *leadingAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
225 | @property (readonly, strong) NSLayoutXAxisAnchor *trailingAnchor API_AVAILABLE(macos(10.11));
226 | @property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:112:30: warning: main actor-isolated property 'bottomAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
| `- warning: main actor-isolated property 'bottomAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
113 | view.trailingAnchor.constraint(equalTo: superview.trailingAnchor),
114 | ])
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:229:51: note: property declared here
227 | @property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
228 | @property (readonly, strong) NSLayoutYAxisAnchor *topAnchor API_AVAILABLE(macos(10.11));
229 | @property (readonly, strong) NSLayoutYAxisAnchor *bottomAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
230 | @property (readonly, strong) NSLayoutDimension *widthAnchor API_AVAILABLE(macos(10.11));
231 | @property (readonly, strong) NSLayoutDimension *heightAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:112:73: warning: main actor-isolated property 'bottomAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
110 | view.topAnchor.constraint(equalTo: superview.topAnchor),
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
| `- warning: main actor-isolated property 'bottomAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
113 | view.trailingAnchor.constraint(equalTo: superview.trailingAnchor),
114 | ])
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:229:51: note: property declared here
227 | @property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
228 | @property (readonly, strong) NSLayoutYAxisAnchor *topAnchor API_AVAILABLE(macos(10.11));
229 | @property (readonly, strong) NSLayoutYAxisAnchor *bottomAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
230 | @property (readonly, strong) NSLayoutDimension *widthAnchor API_AVAILABLE(macos(10.11));
231 | @property (readonly, strong) NSLayoutDimension *heightAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:113:30: warning: main actor-isolated property 'trailingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
113 | view.trailingAnchor.constraint(equalTo: superview.trailingAnchor),
| `- warning: main actor-isolated property 'trailingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
114 | ])
115 | }
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:225:51: note: property declared here
223 | */
224 | @property (readonly, strong) NSLayoutXAxisAnchor *leadingAnchor API_AVAILABLE(macos(10.11));
225 | @property (readonly, strong) NSLayoutXAxisAnchor *trailingAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
226 | @property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
227 | @property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:113:75: warning: main actor-isolated property 'trailingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
111 | view.leadingAnchor.constraint(equalTo: superview.leadingAnchor),
112 | view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
113 | view.trailingAnchor.constraint(equalTo: superview.trailingAnchor),
| `- warning: main actor-isolated property 'trailingAnchor' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
114 | ])
115 | }
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutConstraint.h:225:51: note: property declared here
223 | */
224 | @property (readonly, strong) NSLayoutXAxisAnchor *leadingAnchor API_AVAILABLE(macos(10.11));
225 | @property (readonly, strong) NSLayoutXAxisAnchor *trailingAnchor API_AVAILABLE(macos(10.11));
| `- note: property declared here
226 | @property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
227 | @property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:116:32: warning: call to main actor-isolated instance method 'removeFromSuperview()' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
114 | ])
115 | }
116 | oldValue.view?.removeFromSuperview()
| `- warning: call to main actor-isolated instance method 'removeFromSuperview()' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
117 | }
118 | player.playbackRate = oldValue.playbackRate
AppKit.NSView.removeFromSuperview:2:22: note: calls to instance method 'removeFromSuperview()' from outside of its actor context are implicitly asynchronous
1 | class NSView {
2 | @MainActor open func removeFromSuperview()}
| |- note: calls to instance method 'removeFromSuperview()' from outside of its actor context are implicitly asynchronous
| `- note: main actor isolation inferred from inheritance from class 'NSResponder'
3 |
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:176:19: warning: capture of 'self' with non-sendable type 'KSPlayerLayer?' in a '@Sendable' closure [#SendableClosureCaptures]
65 | }
66 |
67 | open class KSPlayerLayer: NSObject {
| `- note: class 'KSPlayerLayer' does not conform to the 'Sendable' protocol
68 | public weak var delegate: KSPlayerLayerDelegate?
69 | @Published
:
174 |
175 | private lazy var timer: Timer = .scheduledTimer(withTimeInterval: 0.1, repeats: true) { [weak self] _ in
176 | guard let self, self.player.isReadyToPlay else {
| `- warning: capture of 'self' with non-sendable type 'KSPlayerLayer?' in a '@Sendable' closure [#SendableClosureCaptures]
177 | return
178 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:179:24: warning: call to main actor-isolated instance method 'player(layer:currentTime:totalTime:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
60 | public protocol KSPlayerLayerDelegate: AnyObject {
61 | func player(layer: KSPlayerLayer, state: KSPlayerState)
62 | func player(layer: KSPlayerLayer, currentTime: TimeInterval, totalTime: TimeInterval)
| `- note: calls to instance method 'player(layer:currentTime:totalTime:)' from outside of its actor context are implicitly asynchronous
63 | func player(layer: KSPlayerLayer, finish error: Error?)
64 | func player(layer: KSPlayerLayer, bufferedCount: Int, consumeTime: TimeInterval)
:
177 | return
178 | }
179 | self.delegate?.player(layer: self, currentTime: self.player.currentPlaybackTime, totalTime: self.player.duration)
| `- warning: call to main actor-isolated instance method 'player(layer:currentTime:totalTime:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
180 | if self.player.playbackState == .playing, self.player.loadState == .playable, self.state == .buffering {
181 | // 一个兜底保护,正常不能走到这里
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:488:5: warning: non-'@objc' instance method declared in extension cannot be overridden; use 'public' instead; this will be an error in a future Swift language mode
486 |
487 | extension KSPlayerLayer {
488 | open func prepareToPlay() {
| `- warning: non-'@objc' instance method declared in extension cannot be overridden; use 'public' instead; this will be an error in a future Swift language mode
489 | state = .preparing
490 | startTime = CACurrentMediaTime()
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:169:36: warning: call to main actor-isolated instance method 'player(layer:state:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
59 | @MainActor
60 | public protocol KSPlayerLayerDelegate: AnyObject {
61 | func player(layer: KSPlayerLayer, state: KSPlayerState)
| `- note: calls to instance method 'player(layer:state:)' from outside of its actor context are implicitly asynchronous
62 | func player(layer: KSPlayerLayer, currentTime: TimeInterval, totalTime: TimeInterval)
63 | func player(layer: KSPlayerLayer, finish error: Error?)
:
167 | guard let self else { return }
168 | KSLog("playerStateDidChange - \(newValue)")
169 | self.delegate?.player(layer: self, state: newValue)
| `- warning: call to main actor-isolated instance method 'player(layer:state:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode [#ActorIsolatedCall]
170 | }
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:281:34: warning: main actor-isolated property 'isIdleTimerDisabled' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
279 | open func play() {
280 | runOnMainThread {
281 | UIApplication.shared.isIdleTimerDisabled = true
| `- warning: main actor-isolated property 'isIdleTimerDisabled' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
282 | }
283 | isAutoPlay = true
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/Core/AppKitExtend.swift:315:9: note: mutation of this property is only permitted within the actor
313 | }
314 |
315 | var isIdleTimerDisabled: Bool {
| `- note: mutation of this property is only permitted within the actor
316 | get {
317 | UIApplication.isIdleTimerDisabled
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:281:27: warning: main actor-isolated class property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
279 | open func play() {
280 | runOnMainThread {
281 | UIApplication.shared.isIdleTimerDisabled = true
| `- warning: main actor-isolated class property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
282 | }
283 | isAutoPlay = true
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:193:61: note: mutation of this class property is only permitted within the actor
191 | APPKIT_EXTERN __kindof NSApplication * _Null_unspecified NSApp NS_SWIFT_UI_ACTOR;
192 |
193 | @property (class, readonly, strong) __kindof NSApplication *sharedApplication;
| `- note: mutation of this class property is only permitted within the actor
194 | @property (nullable, weak) id<NSApplicationDelegate> delegate;
195 |
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:314:34: warning: main actor-isolated property 'isIdleTimerDisabled' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
312 | MPNowPlayingInfoCenter.default().playbackState = .paused
313 | runOnMainThread {
314 | UIApplication.shared.isIdleTimerDisabled = false
| `- warning: main actor-isolated property 'isIdleTimerDisabled' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
315 | }
316 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/Core/AppKitExtend.swift:315:9: note: mutation of this property is only permitted within the actor
313 | }
314 |
315 | var isIdleTimerDisabled: Bool {
| `- note: mutation of this property is only permitted within the actor
316 | get {
317 | UIApplication.isIdleTimerDisabled
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:314:27: warning: main actor-isolated class property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
312 | MPNowPlayingInfoCenter.default().playbackState = .paused
313 | runOnMainThread {
314 | UIApplication.shared.isIdleTimerDisabled = false
| `- warning: main actor-isolated class property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
315 | }
316 | }
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:193:61: note: mutation of this class property is only permitted within the actor
191 | APPKIT_EXTERN __kindof NSApplication * _Null_unspecified NSApp NS_SWIFT_UI_ACTOR;
192 |
193 | @property (class, readonly, strong) __kindof NSApplication *sharedApplication;
| `- note: mutation of this class property is only permitted within the actor
194 | @property (nullable, weak) id<NSApplicationDelegate> delegate;
195 |
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:328:34: warning: main actor-isolated property 'isIdleTimerDisabled' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
326 | MPNowPlayingInfoCenter.default().nowPlayingInfo = nil
327 | runOnMainThread {
328 | UIApplication.shared.isIdleTimerDisabled = false
| `- warning: main actor-isolated property 'isIdleTimerDisabled' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
329 | }
330 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/Core/AppKitExtend.swift:315:9: note: mutation of this property is only permitted within the actor
313 | }
314 |
315 | var isIdleTimerDisabled: Bool {
| `- note: mutation of this property is only permitted within the actor
316 | get {
317 | UIApplication.isIdleTimerDisabled
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:328:27: warning: main actor-isolated class property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
326 | MPNowPlayingInfoCenter.default().nowPlayingInfo = nil
327 | runOnMainThread {
328 | UIApplication.shared.isIdleTimerDisabled = false
| `- warning: main actor-isolated class property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
329 | }
330 | }
/Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:193:61: note: mutation of this class property is only permitted within the actor
191 | APPKIT_EXTERN __kindof NSApplication * _Null_unspecified NSApp NS_SWIFT_UI_ACTOR;
192 |
193 | @property (class, readonly, strong) __kindof NSApplication *sharedApplication;
| `- note: mutation of this class property is only permitted within the actor
194 | @property (nullable, weak) id<NSApplicationDelegate> delegate;
195 |
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:84:35: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
82 | // 一定要async才不会pip之后就暂停播放
83 | DispatchQueue.main.async { [weak self] in
84 | guard let self else { return }
| |- warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: task-isolated 'self' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
85 | pipController.start(view: self)
86 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:85:25: warning: sending 'pipController' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
83 | DispatchQueue.main.async { [weak self] in
84 | guard let self else { return }
85 | pipController.start(view: self)
| |- warning: sending 'pipController' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: task-isolated 'pipController' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
86 | }
87 | } else {
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:169:36: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
167 | guard let self else { return }
168 | KSLog("playerStateDidChange - \(newValue)")
169 | self.delegate?.player(layer: self, state: newValue)
| |- warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending task-isolated 'self' to main actor-isolated instance method 'player(layer:state:)' risks causing data races between main actor-isolated and task-isolated uses
170 | }
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:169:36: warning: sending 'newValue' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
167 | guard let self else { return }
168 | KSLog("playerStateDidChange - \(newValue)")
169 | self.delegate?.player(layer: self, state: newValue)
| |- warning: sending 'newValue' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending task-isolated 'newValue' to main actor-isolated instance method 'player(layer:state:)' risks causing data races between main actor-isolated and task-isolated uses
170 | }
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:169:36: warning: sending value of non-Sendable type 'any KSPlayerLayerDelegate' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
167 | guard let self else { return }
168 | KSLog("playerStateDidChange - \(newValue)")
169 | self.delegate?.player(layer: self, state: newValue)
| |- warning: sending value of non-Sendable type 'any KSPlayerLayerDelegate' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending task-isolated value of non-Sendable type 'any KSPlayerLayerDelegate' to main actor-isolated instance method 'player(layer:state:)' risks causing races in between task-isolated and main actor-isolated uses
170 | }
171 | }
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:179:24: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
177 | return
178 | }
179 | self.delegate?.player(layer: self, currentTime: self.player.currentPlaybackTime, totalTime: self.player.duration)
| |- warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending 'self' to main actor-isolated instance method 'player(layer:currentTime:totalTime:)' risks causing data races between main actor-isolated and local nonisolated uses
180 | if self.player.playbackState == .playing, self.player.loadState == .playable, self.state == .buffering {
| `- note: access can happen concurrently
181 | // 一个兜底保护,正常不能走到这里
182 | self.state = .bufferFinished
/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift:179:24: warning: sending value of non-Sendable type 'any KSPlayerLayerDelegate' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
177 | return
178 | }
179 | self.delegate?.player(layer: self, currentTime: self.player.currentPlaybackTime, totalTime: self.player.duration)
| |- warning: sending value of non-Sendable type 'any KSPlayerLayerDelegate' risks causing data races; this is an error in the Swift 6 language mode [#SendingRisksDataRace]
| `- note: sending value of non-Sendable type 'any KSPlayerLayerDelegate' to main actor-isolated instance method 'player(layer:currentTime:totalTime:)' risks causing data races between main actor-isolated and local nonisolated uses
180 | if self.player.playbackState == .playing, self.player.loadState == .playable, self.state == .buffering {
| `- note: access can happen concurrently
181 | // 一个兜底保护,正常不能走到这里
182 | self.state = .bufferFinished
[#ActorIsolatedCall]: <https://docs.swift.org/compiler/documentation/diagnostics/actor-isolated-call>
[#ConformanceIsolation]: <https://docs.swift.org/compiler/documentation/diagnostics/conformance-isolation>
[#MutableGlobalVariable]: <https://docs.swift.org/compiler/documentation/diagnostics/mutable-global-variable>
[#SendableClosureCaptures]: <https://docs.swift.org/compiler/documentation/diagnostics/sendable-closure-captures>
[#SendingRisksDataRace]: <https://docs.swift.org/compiler/documentation/diagnostics/sending-risks-data-race>
Build complete! (68.97s)
Fetching https://github.com/kingslay/FFmpegKit.git
[1/8612] Fetching ffmpegkit
Fetched https://github.com/kingslay/FFmpegKit.git from cache (46.77s)
Computing version for https://github.com/kingslay/FFmpegKit.git
Computed https://github.com/kingslay/FFmpegKit.git at 6.1.3 (47.48s)
Creating working copy for https://github.com/kingslay/FFmpegKit.git
Working copy of https://github.com/kingslay/FFmpegKit.git resolved at 6.1.3
warning: failed to retrieve search paths with pkg-config; maybe pkg-config is not installed
warning: you may be able to install sdl2 using your system-packager:
brew install sdl2
warning: you may be able to install sdl2 using your system-packager:
brew install sdl2
Build complete.
{
"default_localization" : "en",
"dependencies" : [
{
"identity" : "ffmpegkit",
"requirement" : {
"range" : [
{
"lower_bound" : "6.1.3",
"upper_bound" : "7.0.0"
}
]
},
"type" : "sourceControl",
"url" : "https://github.com/kingslay/FFmpegKit.git"
}
],
"manifest_display_name" : "KSPlayer",
"name" : "KSPlayer",
"path" : "/Users/admin/builder/spi-builder-workspace",
"platforms" : [
{
"name" : "macos",
"version" : "10.15"
},
{
"name" : "maccatalyst",
"version" : "13.0"
},
{
"name" : "ios",
"version" : "13.0"
},
{
"name" : "tvos",
"version" : "13.0"
},
{
"name" : "visionos",
"version" : "1.0"
}
],
"products" : [
{
"name" : "KSPlayer",
"targets" : [
"KSPlayer"
],
"type" : {
"library" : [
"automatic"
]
}
}
],
"targets" : [
{
"c99name" : "KSPlayerTests",
"module_type" : "SwiftTarget",
"name" : "KSPlayerTests",
"path" : "Tests/KSPlayerTests",
"resources" : [
{
"path" : "/Users/admin/builder/spi-builder-workspace/Tests/KSPlayerTests/Resources/test.m3u",
"rule" : {
"process" : {
}
}
}
],
"sources" : [
"AudioTest.swift",
"KSAVPlayerTest.swift",
"KSMEPlayerTest.swift",
"KSPlayerLayerTest.swift",
"M3UParseTest.swift",
"SubtitleTest.swift",
"VideoPlayerControllerTest.swift",
"VideoPlayerViewTest.swift"
],
"target_dependencies" : [
"KSPlayer"
],
"type" : "test"
},
{
"c99name" : "KSPlayer",
"module_type" : "SwiftTarget",
"name" : "KSPlayer",
"path" : "Sources/KSPlayer",
"product_dependencies" : [
"FFmpegKit"
],
"product_memberships" : [
"KSPlayer"
],
"resources" : [
{
"path" : "/Users/admin/builder/spi-builder-workspace/Sources/KSPlayer/Metal/Shaders.metal",
"rule" : {
"process" : {
}
}
}
],
"sources" : [
"AVPlayer/KSAVPlayer.swift",
"AVPlayer/KSOptions.swift",
"AVPlayer/KSPictureInPictureController.swift",
"AVPlayer/KSPlayerLayer.swift",
"AVPlayer/KSVideoPlayer.swift",
"AVPlayer/MediaPlayerProtocol.swift",
"AVPlayer/PlayerDefines.swift",
"Audio/AudioPlayerView.swift",
"Core/AppKitExtend.swift",
"Core/PlayerToolBar.swift",
"Core/PlayerView.swift",
"Core/UIKitExtend.swift",
"Core/UXKit.swift",
"Core/Utility.swift",
"MEPlayer/AVFFmpegExtension.swift",
"MEPlayer/AVFoundationExtension.swift",
"MEPlayer/AudioEnginePlayer.swift",
"MEPlayer/AudioGraphPlayer.swift",
"MEPlayer/AudioRendererPlayer.swift",
"MEPlayer/AudioUnitPlayer.swift",
"MEPlayer/CircularBuffer.swift",
"MEPlayer/EmbedDataSouce.swift",
"MEPlayer/FFmpegAssetTrack.swift",
"MEPlayer/FFmpegDecode.swift",
"MEPlayer/Filter.swift",
"MEPlayer/KSMEPlayer.swift",
"MEPlayer/MEPlayerItem.swift",
"MEPlayer/MEPlayerItemTrack.swift",
"MEPlayer/MetalPlayView.swift",
"MEPlayer/Model.swift",
"MEPlayer/Resample.swift",
"MEPlayer/SubtitleDecode.swift",
"MEPlayer/ThumbnailController.swift",
"MEPlayer/VideoToolboxDecode.swift",
"Metal/DisplayModel.swift",
"Metal/MetalRender.swift",
"Metal/MotionSensor.swift",
"Metal/PixelBufferProtocol.swift",
"Metal/Transforms.swift",
"Subtitle/AudioRecognize.swift",
"Subtitle/KSParseProtocol.swift",
"Subtitle/KSSubtitle.swift",
"Subtitle/SubtitleDataSouce.swift",
"SwiftUI/AirPlayView.swift",
"SwiftUI/KSVideoPlayerView.swift",
"SwiftUI/KSVideoPlayerViewBuilder.swift",
"SwiftUI/LiveTextImage.swift",
"SwiftUI/Slider.swift",
"Video/BrightnessVolume.swift",
"Video/IOSVideoPlayerView.swift",
"Video/KSMenu.swift",
"Video/KSPlayerItem.swift",
"Video/MacVideoPlayerView.swift",
"Video/PlayerFullScreenViewController.swift",
"Video/PlayerTransitionAnimator.swift",
"Video/SeekView.swift",
"Video/VideoPlayerView.swift"
],
"target_dependencies" : [
"DisplayCriteria"
],
"type" : "library"
},
{
"c99name" : "DisplayCriteria",
"module_type" : "ClangTarget",
"name" : "DisplayCriteria",
"path" : "Sources/DisplayCriteria",
"product_memberships" : [
"KSPlayer"
],
"sources" : [
"DisplayCriteria.m"
],
"type" : "library"
}
],
"tools_version" : "5.9"
}
Done.