清除无效代码
This commit is contained in:
parent
7dc28e5c6c
commit
a898f957f9
@ -269,13 +269,6 @@ class CCSpatialShootController: BaseController {
|
|||||||
|
|
||||||
outputVideoURL = URL.documentsDirectory.appendingPathComponent("output.MOV")
|
outputVideoURL = URL.documentsDirectory.appendingPathComponent("output.MOV")
|
||||||
|
|
||||||
//======
|
|
||||||
|
|
||||||
// 开始生成设备方向通知
|
|
||||||
// UIDevice.current.beginGeneratingDeviceOrientationNotifications()
|
|
||||||
// // 监听 UIDevice.orientationDidChangeNotification
|
|
||||||
// NotificationCenter.default.addObserver(self, selector: #selector(orientationDidChange), name: UIDevice.orientationDidChangeNotification, object: nil)
|
|
||||||
|
|
||||||
configureSession() // 设置相机参数
|
configureSession() // 设置相机参数
|
||||||
|
|
||||||
setUI()
|
setUI()
|
||||||
@ -302,7 +295,7 @@ class CCSpatialShootController: BaseController {
|
|||||||
|
|
||||||
//读取相册第一张照片
|
//读取相册第一张照片
|
||||||
getAlbumFirstPhoto()
|
getAlbumFirstPhoto()
|
||||||
orientationDidChange()
|
// orientationDidChange()
|
||||||
enableShutterBtn(false)
|
enableShutterBtn(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,16 +496,7 @@ class CCSpatialShootController: BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//MARK: - 显示提示
|
|
||||||
func showTips() {
|
|
||||||
// self.view.addSubview(tipsLabel)
|
|
||||||
// self.view.bringSubviewToFront(tipsLabel)
|
|
||||||
// UIView.animate(withDuration: 3, delay: 2.0,options: .curveEaseInOut) {
|
|
||||||
// self.tipsLabel.alpha = 0
|
|
||||||
// } completion: { finished in
|
|
||||||
// self.tipsLabel.isHidden = true
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
func showHorizontalScreenTips() {
|
func showHorizontalScreenTips() {
|
||||||
self.horizontalImageView.isHidden = false
|
self.horizontalImageView.isHidden = false
|
||||||
@ -617,19 +601,6 @@ class CCSpatialShootController: BaseController {
|
|||||||
//拍照
|
//拍照
|
||||||
@objc func shutterPhotoButtonAction(){
|
@objc func shutterPhotoButtonAction(){
|
||||||
|
|
||||||
// do {
|
|
||||||
// try wideAngleCameraDevice?.lockForConfiguration()
|
|
||||||
//// wideAngleCameraDevice?.ramp(toVideoZoomFactor: wideAngleCameraDevice!.videoZoomFactor+1.0, withRate: 2)
|
|
||||||
// wideAngleCameraDevice?.videoZoomFactor = wideAngleCameraDevice!.videoZoomFactor+1.0
|
|
||||||
// wideAngleCameraDevice?.unlockForConfiguration()
|
|
||||||
//
|
|
||||||
// print("factor:\(wideAngleCameraDevice!.videoZoomFactor)")
|
|
||||||
// }
|
|
||||||
// catch {
|
|
||||||
// print("wide:err")
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return
|
|
||||||
|
|
||||||
shutterPhotoButton.backgroundColor = .gray
|
shutterPhotoButton.backgroundColor = .gray
|
||||||
|
|
||||||
@ -900,46 +871,7 @@ class CCSpatialShootController: BaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc fileprivate func orientationDidChange() {
|
|
||||||
// enableShutterBtn(false)
|
|
||||||
// switch UIDevice.current.orientation {
|
|
||||||
// case .unknown:
|
|
||||||
// print("未知")
|
|
||||||
// case .portrait:
|
|
||||||
// print("竖屏")
|
|
||||||
// imageCGImagePropertyOrientation = .up
|
|
||||||
// imageOrientation = .up
|
|
||||||
//
|
|
||||||
// autoStopRecordVideo()
|
|
||||||
// showHorizontalScreenTips()
|
|
||||||
// case .portraitUpsideDown:
|
|
||||||
// print("颠倒竖屏")
|
|
||||||
// autoStopRecordVideo()
|
|
||||||
// imageCGImagePropertyOrientation = .down
|
|
||||||
// imageOrientation = .down
|
|
||||||
// showHorizontalScreenTips()
|
|
||||||
// case .landscapeLeft:
|
|
||||||
// print("设备向左旋转横屏")
|
|
||||||
// imageCGImagePropertyOrientation = .left
|
|
||||||
// imageOrientation = .left
|
|
||||||
// hidenHorizontalScreenTips()
|
|
||||||
// enableShutterBtn(true)
|
|
||||||
// case .landscapeRight:
|
|
||||||
// print("设备向右旋转横屏")
|
|
||||||
// imageCGImagePropertyOrientation = .right
|
|
||||||
// imageOrientation = .right
|
|
||||||
// hidenHorizontalScreenTips()
|
|
||||||
// enableShutterBtn(true)
|
|
||||||
// case .faceUp:
|
|
||||||
// autoStopRecordVideo()
|
|
||||||
// print("屏幕朝上")
|
|
||||||
// case .faceDown:
|
|
||||||
// autoStopRecordVideo()
|
|
||||||
// print("屏幕朝下")
|
|
||||||
// default:
|
|
||||||
// break
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
//当屏幕转向发生改变时,自动结束录像
|
//当屏幕转向发生改变时,自动结束录像
|
||||||
func autoStopRecordVideo(){
|
func autoStopRecordVideo(){
|
||||||
@ -953,7 +885,6 @@ class CCSpatialShootController: BaseController {
|
|||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
// 移除通知
|
// 移除通知
|
||||||
// NotificationCenter.default.removeObserver(self, name: UIDevice.orientationDidChangeNotification, object: nil)
|
|
||||||
// // 结束生成设备旋转方向通知
|
// // 结束生成设备旋转方向通知
|
||||||
// UIDevice.current.endGeneratingDeviceOrientationNotifications()
|
// UIDevice.current.endGeneratingDeviceOrientationNotifications()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user