Open jln19 opened 8 years ago
you want to upload each segment? I think you should be using didCompleteSession..
But either way, here is how I do it (in swift, but same idea)
func recorder(recorder: SCRecorder, didCompleteSession session: SCRecordSession) {
if(!isCreatingVideo){
isCreatingVideo = true
var exporter = SCAssetExportSession(asset: (self.recorder.session?.assetRepresentingSegments())!)
exporter.outputFileType = AVFileTypeMPEG4
exporter.outputUrl = session.outputUrl
exporter.exportAsynchronouslyWithCompletionHandler {
if let error = exporter.error {
//
print(error.debugDescription)
} else {
self.videoURL = exporter.outputUrl
}
}
}
}
videoData is always nil, even though url is valid:
file:///private/var/mobile/Applications/6A92163A-9A8D-4915-B680-F93424F1E9F4/tmp/ytDg2Vt8K0l4-SCVideo-Merged.mov
I need the video data to send to a server. How do you recommend doing this?