//
//  CCSpatialShootController+GenerateVideo.swift
//  SwiftProject
//
//  Created by aaa on 2024/5/22.
//

import Foundation
import Photos

extension CCSpatialShootController {
    
    
    
   
    //MARK: 空间视频合成
//    func createSpVideo(vd:ZVideoData){
//        svdWriter.writeVideoData(leftSamplebuffer: vd.leftSampleBuffer!, rightSamplebuffer: vd.rightSampleBuffer!, audioSamplebuffer: vd.audioSampleBuffer!)
//    }
    
     func saveVideoToLibrary(videoURL: URL) {
        PHPhotoLibrary.shared().performChanges({
            PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: videoURL)
        }) {[weak self] success, error in
            if success {
                print("保存成功")
                self?.getAlbumFirstPhoto()
            } else if let error = error {
                print("保存失败")
            }
        }
    }
    
    
}
