From 034d21525cb04ece1a58b0de348d443e7a8238d4 Mon Sep 17 00:00:00 2001 From: bluesea <307723040@qq.com> Date: Tue, 9 Apr 2024 11:04:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E6=8E=89=E6=97=A0=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CCSpatialVideoDisplayController.swift | 28 ------------------- .../CCSpatialVideoDisplayForVideoTask.swift | 7 ----- 2 files changed, 35 deletions(-) diff --git a/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayController.swift b/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayController.swift index d7e130a..b1dc38a 100644 --- a/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayController.swift +++ b/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayController.swift @@ -246,8 +246,6 @@ class CCSpatialVideoDisplayController: BaseController { override func viewDidLoad() { super.viewDidLoad() ZZHHelper.setNowTimeToUserDefaultWithKey(kNowTimeToUserDefaultKey_VideoDisplayController) - - Task { print("ccs viewdid load ---------") await self.loadVideoAssetReader() @@ -256,34 +254,9 @@ class CCSpatialVideoDisplayController: BaseController { // 检查当前是否已连接到 AirPlay 设备 self.checkAirPlayStatus() } -// DispatchQueue.main.async { -// -// } } } -// override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { -// print("播放状态\(keyPath)改变...\(change).") -// if(keyPath == "status"){ -// guard let ce = change else { -// return -// } -// -// let newVa = ce[NSKeyValueChangeKey.kindKey] as? Int -// -// if newVa != nil { -// if AVPlayer.Status(rawValue: newVa!) == .readyToPlay { -// DispatchQueue.main.async {[weak self] in -// print(">>>>>>bo fang....") -// self?.player?.play() -// } -// } -// } -// -// -// -// } -// } func configureInfo(){ @@ -291,7 +264,6 @@ class CCSpatialVideoDisplayController: BaseController { player = AVPlayer() player?.allowsExternalPlayback = true player?.usesExternalPlaybackWhileExternalScreenIsActive = true -// player?.addObserver(self, forKeyPath: "status", context: nil) print("getPlayerItem >>>>>>>") self.view.backgroundColor = UIColor(hexString: "#060507") diff --git a/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayForVideoTask.swift b/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayForVideoTask.swift index dc5c1e9..dab6566 100644 --- a/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayForVideoTask.swift +++ b/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/CCSpatialVideoDisplayForVideoTask.swift @@ -115,13 +115,9 @@ extension CCSpatialVideoDisplayController { do { if self.assetTrack == nil { assetTrack = try await self.videoOriginalAsset.loadTracks(withMediaType: .video).first! -// print("等待loading tracks。。。。。") } -// let timeRange = CMTimeRange(start: .zero, duration: .positiveInfinity) -// print("加载完毕loading tracks。。。。。") let timeRange = CMTimeRange(start: .zero, duration: CMTime(value: 1, timescale: 1)) DispatchQueue.main.async { -// print("进入主线程loading tracks。。。。。") self.quickLoadAReader(timeRange: timeRange) } @@ -161,8 +157,5 @@ extension CCSpatialVideoDisplayController { print("资产加载完毕。。。。开始播放player\n err:\(self.player?.error)") } - - - } }