diff --git a/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/ZZHCustomPlayer.swift b/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/ZZHCustomPlayer.swift index f850ac4..fc8e592 100644 --- a/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/ZZHCustomPlayer.swift +++ b/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialVideoDisplayController/ZZHCustomPlayer.swift @@ -140,13 +140,17 @@ class ZZHCustomPlayer: UIView { make.height.equalTo(playerHeight) } avPlayer = AVPlayer() +// avPlayer?.allowsExternalPlayback = true +// avPlayer?.usesExternalPlaybackWhileExternalScreenIsActive = true +// avPlayer?.externalPlaybackVideoGravity = .resizeAspect + avPlayer?.addPeriodicTimeObserver(forInterval: CMTime(value: 1, timescale: self.avPlayer?.currentItem?.duration.timescale ?? 600), queue: DispatchQueue.main, using: {[weak self] ct in self?.updateSliderUI(ct: ct) }) avPlayerLayer = AVPlayerLayer(player: avPlayer) avPlayerLayer?.frame = CGRect(x: 0, y: 0, width: Int(playerWidth), height: playerHeight) - avPlayerLayer?.videoGravity = .resizeAspectFill + avPlayerLayer?.videoGravity = .resizeAspect playerLayerBgView!.layer.addSublayer(avPlayerLayer!) // playerLayerBgView?.backgroundColor = UIColor.red // self.backgroundColor = .orange