清除不需要的代码
This commit is contained in:
parent
9c3ec43bb4
commit
06e0b38c98
Binary file not shown.
@ -515,8 +515,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 = "280"
|
||||||
endingLineNumber = "340"
|
endingLineNumber = "280"
|
||||||
landmarkName = "notification_didActiveNotification(notification:)"
|
landmarkName = "notification_didActiveNotification(notification:)"
|
||||||
landmarkType = "7">
|
landmarkType = "7">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
|
|||||||
@ -94,12 +94,6 @@ class CCSpatialVideoDisplayController: BaseController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// let videoTranserConvertor = PlayByTransferConvertor()
|
|
||||||
|
|
||||||
// lazy var videoOriginalAsset:AVAsset = {
|
|
||||||
// let asset = AVAsset(url: sourceVideoURL!)
|
|
||||||
// return asset
|
|
||||||
// }()
|
|
||||||
|
|
||||||
var videoOriginalPHAsset:PHAsset?
|
var videoOriginalPHAsset:PHAsset?
|
||||||
|
|
||||||
@ -107,9 +101,7 @@ class CCSpatialVideoDisplayController: BaseController {
|
|||||||
var sourceVideoURL:URL?
|
var sourceVideoURL:URL?
|
||||||
var imgData:Data?
|
var imgData:Data?
|
||||||
|
|
||||||
// var player:AVPlayer?
|
|
||||||
// var needRestReaderTimeRange = false//标识是否需呀重置时间读取范围
|
|
||||||
// var playerController:AVPlayerViewController?
|
|
||||||
var customPlayer:ZZHCustomPlayer = {
|
var customPlayer:ZZHCustomPlayer = {
|
||||||
let cp = ZZHCustomPlayer(frame: .zero)
|
let cp = ZZHCustomPlayer(frame: .zero)
|
||||||
return cp
|
return cp
|
||||||
@ -222,64 +214,16 @@ class CCSpatialVideoDisplayController: BaseController {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
||||||
//监听播放完毕
|
|
||||||
// @objc func notification_PlayerEndTime(notification:Notification){
|
|
||||||
// print("PlayerEndTime....")
|
|
||||||
// player?.seek(to: .zero)
|
|
||||||
// player?.play()
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
//监听拖动播放的进度事件
|
|
||||||
// @objc func notification_PlayerTimeJump(notification:Notification){
|
|
||||||
//// needRestReaderTimeRange = true
|
|
||||||
//
|
|
||||||
// print("time jump....")
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
configureUI()
|
configureUI()
|
||||||
ZZHHelper.setNowTimeToUserDefaultWithKey(kNowTimeToUserDefaultKey_VideoDisplayController)
|
ZZHHelper.setNowTimeToUserDefaultWithKey(kNowTimeToUserDefaultKey_VideoDisplayController)
|
||||||
// Task {
|
|
||||||
// print("ccs viewdid load ---------")
|
|
||||||
// await self.loadVideoAssetReader()
|
|
||||||
// DispatchQueue.main.asyncAfter(deadline: .now()+0.01) {[weak self] in
|
|
||||||
// self?.setUPPlayer()
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
self.customPlayer.setUPPlayer()
|
self.customPlayer.setUPPlayer()
|
||||||
// 检查当前是否已连接到 AirPlay 设备
|
// 检查当前是否已连接到 AirPlay 设备
|
||||||
self.checkAirPlayStatus()
|
self.checkAirPlayStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
// func setUPPlayer(){
|
|
||||||
// print("getPlayerItem ========")
|
|
||||||
// player = AVPlayer()
|
|
||||||
// player?.allowsExternalPlayback = true
|
|
||||||
// player?.usesExternalPlaybackWhileExternalScreenIsActive = true
|
|
||||||
//
|
|
||||||
// print("getPlayerItem >>>>>>>")
|
|
||||||
//
|
|
||||||
// playerController = AVPlayerViewController()
|
|
||||||
// playerController?.player = player
|
|
||||||
// playerController!.view.backgroundColor = .clear
|
|
||||||
// playerController?.view.frame = CGRect.init(x: 0, y: 170, width: self.view.frame.size.width, height: 400)
|
|
||||||
//
|
|
||||||
// self.addChild(playerController!)
|
|
||||||
// self.view.addSubview(playerController!.view)
|
|
||||||
//
|
|
||||||
// self.maskLabel.frame = playerController!.view.frame
|
|
||||||
// self.view.addSubview(self.maskLabel)
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
func configureUI(){
|
func configureUI(){
|
||||||
self.view.backgroundColor = UIColor(hexString: "#060507")
|
self.view.backgroundColor = UIColor(hexString: "#060507")
|
||||||
@ -319,10 +263,6 @@ class CCSpatialVideoDisplayController: BaseController {
|
|||||||
NotificationCenter.default.addObserver(self, selector: #selector(exScreenDisConnectNotification(notification:)), name: UIScene.didDisconnectNotification, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(exScreenDisConnectNotification(notification:)), name: UIScene.didDisconnectNotification, object: nil)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// NotificationCenter.default.addObserver(self, selector: #selector(notification_PlayerEndTime(notification:)), name: AVPlayerItem.didPlayToEndTimeNotification, object: nil)
|
|
||||||
// NotificationCenter.default.addObserver(self, selector: #selector(notification_PlayerTimeJump(notification:)), name: AVPlayerItem.timeJumpedNotification, object: nil)
|
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(notificatin_failedToPlayToEndTimeNotification(notifiation: )), name: AVPlayerItem.failedToPlayToEndTimeNotification, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(notificatin_failedToPlayToEndTimeNotification(notifiation: )), name: AVPlayerItem.failedToPlayToEndTimeNotification, object: nil)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(notificatin_failedToPlayToEndTimeNotification(notifiation: )), name: AVPlayerItem.newErrorLogEntryNotification, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(notificatin_failedToPlayToEndTimeNotification(notifiation: )), name: AVPlayerItem.newErrorLogEntryNotification, object: nil)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(notification_didEnterBackgroundNotification(notification: )), name: UIApplication.didEnterBackgroundNotification, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(notification_didEnterBackgroundNotification(notification: )), name: UIApplication.didEnterBackgroundNotification, object: nil)
|
||||||
@ -359,7 +299,6 @@ class CCSpatialVideoDisplayController: BaseController {
|
|||||||
if externalVC != nil {
|
if externalVC != nil {
|
||||||
externalVC?.playerLayer?.player = nil
|
externalVC?.playerLayer?.player = nil
|
||||||
}
|
}
|
||||||
// player?.pause()
|
|
||||||
customPlayer.play(false)
|
customPlayer.play(false)
|
||||||
releaseVideoComposition()
|
releaseVideoComposition()
|
||||||
|
|
||||||
@ -441,8 +380,6 @@ class CCSpatialVideoDisplayController: BaseController {
|
|||||||
link = true
|
link = true
|
||||||
isPlaying = true
|
isPlaying = true
|
||||||
print("外接屏幕已连接.....")
|
print("外接屏幕已连接.....")
|
||||||
// activeSession()
|
|
||||||
|
|
||||||
UIApplication.shared.connectedScenes.forEach { us in
|
UIApplication.shared.connectedScenes.forEach { us in
|
||||||
print("uisence:\(us)\n")
|
print("uisence:\(us)\n")
|
||||||
let ws = us as! UIWindowScene
|
let ws = us as! UIWindowScene
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user