去掉对status的监听
This commit is contained in:
parent
5377417a1e
commit
684a5f3cf0
Binary file not shown.
@ -611,8 +611,8 @@
|
|||||||
filePath = "SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayController.swift"
|
filePath = "SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayController.swift"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "340"
|
startingLineNumber = "347"
|
||||||
endingLineNumber = "340"
|
endingLineNumber = "347"
|
||||||
landmarkName = "viewDidAppear(_:)"
|
landmarkName = "viewDidAppear(_:)"
|
||||||
landmarkType = "7">
|
landmarkType = "7">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
@ -627,10 +627,42 @@
|
|||||||
filePath = "SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayController.swift"
|
filePath = "SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayController.swift"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "627"
|
startingLineNumber = "634"
|
||||||
endingLineNumber = "627"
|
endingLineNumber = "634"
|
||||||
landmarkName = "selectedSpatialType(selectedIndex:)"
|
landmarkName = "selectedSpatialType(selectedIndex:)"
|
||||||
landmarkType = "7">
|
landmarkType = "7">
|
||||||
|
<Locations>
|
||||||
|
<Location
|
||||||
|
uuid = "EF28D223-534C-4D5B-8564-50D9720BA766 - 6adcab4b430491b5"
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
symbolName = "SwiftProject.CCSpatialVideoDisplayController.selectedSpatialType(selectedIndex: Swift.Int) -> ()"
|
||||||
|
moduleName = "SwiftProject"
|
||||||
|
usesParentBreakpointCondition = "Yes"
|
||||||
|
urlString = "file:///Users/aaa/Documents/IOS%20Dev/VR/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayController.swift"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "632"
|
||||||
|
endingLineNumber = "632"
|
||||||
|
offsetFromSymbolStart = "56">
|
||||||
|
</Location>
|
||||||
|
<Location
|
||||||
|
uuid = "EF28D223-534C-4D5B-8564-50D9720BA766 - 6adcab4b430491b5"
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
symbolName = "SwiftProject.CCSpatialVideoDisplayController.selectedSpatialType(selectedIndex: Swift.Int) -> ()"
|
||||||
|
moduleName = "SwiftProject"
|
||||||
|
usesParentBreakpointCondition = "Yes"
|
||||||
|
urlString = "file:///Users/aaa/Documents/IOS%20Dev/VR/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayController.swift"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "632"
|
||||||
|
endingLineNumber = "632"
|
||||||
|
offsetFromSymbolStart = "52">
|
||||||
|
</Location>
|
||||||
|
</Locations>
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
</Breakpoints>
|
</Breakpoints>
|
||||||
|
|||||||
@ -233,32 +233,39 @@ class CCSpatialVideoDisplayController: BaseController {
|
|||||||
Task {
|
Task {
|
||||||
print("ccs viewdid load ---------")
|
print("ccs viewdid load ---------")
|
||||||
await self.loadVideoAssetReader()
|
await self.loadVideoAssetReader()
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.asyncAfter(deadline: .now()+0.2) {
|
||||||
self.configureInfo()
|
self.configureInfo()
|
||||||
// 检查当前是否已连接到 AirPlay 设备
|
// 检查当前是否已连接到 AirPlay 设备
|
||||||
self.checkAirPlayStatus()
|
self.checkAirPlayStatus()
|
||||||
}
|
}
|
||||||
|
// DispatchQueue.main.async {
|
||||||
|
//
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
|
// override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
|
||||||
print("播放状态status改变....")
|
// print("播放状态\(keyPath)改变...\(change).")
|
||||||
if(keyPath == "status"){
|
// if(keyPath == "status"){
|
||||||
guard let ce = change else {
|
// guard let ce = change else {
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
let newVa = ce[NSKeyValueChangeKey.newKey] as! AVPlayer.Status
|
// let newVa = ce[NSKeyValueChangeKey.kindKey] as? Int
|
||||||
let oldVa = ce[NSKeyValueChangeKey.oldKey] as! AVPlayer.Status
|
//
|
||||||
if (newVa != oldVa) {
|
// if newVa != nil {
|
||||||
if newVa == .readyToPlay {
|
// if AVPlayer.Status(rawValue: newVa!) == .readyToPlay {
|
||||||
player?.play()
|
// DispatchQueue.main.async {[weak self] in
|
||||||
}
|
// print(">>>>>>bo fang....")
|
||||||
}
|
// self?.player?.play()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
func configureInfo(){
|
func configureInfo(){
|
||||||
|
|
||||||
@ -266,7 +273,7 @@ class CCSpatialVideoDisplayController: BaseController {
|
|||||||
player = AVPlayer()
|
player = AVPlayer()
|
||||||
player?.allowsExternalPlayback = true
|
player?.allowsExternalPlayback = true
|
||||||
player?.usesExternalPlaybackWhileExternalScreenIsActive = true
|
player?.usesExternalPlaybackWhileExternalScreenIsActive = true
|
||||||
player?.addObserver(self, forKeyPath: "status", context: nil)
|
// player?.addObserver(self, forKeyPath: "status", context: nil)
|
||||||
|
|
||||||
print("getPlayerItem >>>>>>>")
|
print("getPlayerItem >>>>>>>")
|
||||||
self.view.backgroundColor = UIColor(hexString: "#060507")
|
self.view.backgroundColor = UIColor(hexString: "#060507")
|
||||||
@ -521,7 +528,7 @@ class CCSpatialVideoDisplayController: BaseController {
|
|||||||
releaseVideoComposition()
|
releaseVideoComposition()
|
||||||
assetReader?.cancelReading()
|
assetReader?.cancelReading()
|
||||||
NotificationCenter.default.removeObserver(self)
|
NotificationCenter.default.removeObserver(self)
|
||||||
player?.removeObserver(self, forKeyPath: "status")
|
// player?.removeObserver(self, forKeyPath: "status")
|
||||||
}
|
}
|
||||||
|
|
||||||
func releaseVideoComposition() {
|
func releaseVideoComposition() {
|
||||||
|
|||||||
@ -157,7 +157,7 @@ extension CCSpatialVideoDisplayController {
|
|||||||
//加载完毕之后再进行play
|
//加载完毕之后再进行play
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
|
|
||||||
self.player!.play()
|
self.player?.play()
|
||||||
|
|
||||||
print("资产加载完毕。。。。开始播放player\n err:\(self.player?.error)")
|
print("资产加载完毕。。。。开始播放player\n err:\(self.player?.error)")
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user