控制视频播放页面的方向旋转

This commit is contained in:
bluesea 2024-04-26 13:48:18 +08:00
parent 61ef45d508
commit f1b0ce48d8
5 changed files with 65 additions and 44 deletions

View File

@ -645,38 +645,38 @@
endingLineNumber = "266"
landmarkName = "touchesCancelled(_:with:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "CD9BB14F-8F94-4719-990D-C68773DB9C48"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "SwiftProject/Project/Controller/RecordingVideo/VRVideoTransformController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "160"
endingLineNumber = "160"
landmarkName = "viewDidLoad()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "9F19BD4E-941C-4D52-B3EF-40E453A907BA"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "SwiftProject/CCKit/Base/BaseVirtualController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "90"
endingLineNumber = "90"
landmarkName = "setNavgationBarColor(color:)"
landmarkType = "7">
<Locations>
<Location
uuid = "91D72EA1-7A61-4702-B30F-5B860A817DC7 - f5a1762b3e6912b0"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "SwiftProject.CCSlider.touchesCancelled(_: Swift.Set&lt;__C.UITouch&gt;, with: Swift.Optional&lt;__C.UIEvent&gt;) -&gt; ()"
moduleName = "SwiftProject"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/aaa/Documents/IOS%20Dev/VR/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/ZZHCustomSlider.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "265"
endingLineNumber = "265"
offsetFromSymbolStart = "560">
</Location>
<Location
uuid = "91D72EA1-7A61-4702-B30F-5B860A817DC7 - f5a1762b3e691297"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "SwiftProject.CCSlider.touchesCancelled(_: Swift.Set&lt;__C.UITouch&gt;, with: Swift.Optional&lt;__C.UIEvent&gt;) -&gt; ()"
moduleName = "SwiftProject"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/aaa/Documents/IOS%20Dev/VR/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/ZZHCustomSlider.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "266"
endingLineNumber = "266"
offsetFromSymbolStart = "560">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy

View File

@ -112,13 +112,10 @@ class BaseVirtualController: UIViewController {
public func setNavgationBarColorImg(color:UIColor){
if(navtionBar == nil){
navtionBar = UIImageView.init()
// navtionBar?.frame = CGRect.init(x: 0, y: 0, width: SCREEN_Width, height: SafeAreaTop_Height)
navtionBar?.frame = CGRect.init(x: 0, y: 0, width: SCREEN_Width, height: SafeAreaTop_Height)
navtionBar?.isUserInteractionEnabled = true
view.addSubview(navtionBar!)
navtionBar?.snp.makeConstraints { make in
make.left.top.right.equalToSuperview()
make.height.equalTo(SafeAreaTop_Height)
}
}
if(navtionImgView == nil){
navtionImgView = UIImageView.init()
@ -130,6 +127,14 @@ class BaseVirtualController: UIViewController {
}
public func updateNavgationBarColorImgMakeConstraint() {
navtionBar?.snp.makeConstraints { make in
make.left.top.right.equalToSuperview()
make.height.equalTo(SafeAreaTop_Height)
}
}
/// 线
///
/// - Parameter color:

View File

@ -306,7 +306,7 @@ class CCSpatialVideoDisplayController: BaseController {
func configureUI(){
self.view.backgroundColor = UIColor(hexString: "#060507")
updateNavgationBarColorImgMakeConstraint()
//
self.setLeftOneBtnImg(imgStr: "spatial_back_button")
self.setNavgationBarColorImg(color: .clear)
@ -563,11 +563,26 @@ class CCSpatialVideoDisplayController: BaseController {
if sender.tag == 200 {
//
}else if sender.tag == 201 {
//
let transVC = VRVideoTransformController()
transVC.videoOriginalPHAsset = self.videoOriginalPHAsset
transVC.sourceVideoURL = sourceVideoURL
self.navigationController?.pushViewController(transVC, animated: true)
let orientation = UIDevice.current.orientation
if orientation == .landscapeLeft || orientation == .landscapeRight {
KAppDelegate?.allowRotation = false
self.setNeedsUpdateOfSupportedInterfaceOrientations()
DispatchQueue.main.asyncAfter(deadline: .now()+0.25, execute: {[weak self] in
//
let transVC = VRVideoTransformController()
transVC.videoOriginalPHAsset = self?.videoOriginalPHAsset
transVC.sourceVideoURL = self?.sourceVideoURL
self?.navigationController?.pushViewController(transVC, animated: true)
})
}
else {
let transVC = VRVideoTransformController()
transVC.videoOriginalPHAsset = self.videoOriginalPHAsset
transVC.sourceVideoURL = self.sourceVideoURL
self.navigationController?.pushViewController(transVC, animated: true)
}
Analytics.logEvent("preview_trans_click", parameters: nil)
}else if sender.tag == 202 {
//

View File

@ -133,7 +133,8 @@ class VRVideoTransformController: BaseController {
override func viewDidLoad() {
super.viewDidLoad()
// KAppDelegate?.allowRotation = false
// self.setNeedsUpdateOfSupportedInterfaceOrientations()
ZZHHelper.setNowTimeToUserDefaultWithKey(kNowTimeToUserDefaultKey_VideoTransformController)
self.view.backgroundColor = UIColor.black