Hello everyone,
I am having a little trouble and this might be simple ot solve. I am trying to display the video I have in one controller to the next. I imported all the files that I need.
let picker = YPImagePicker(configuration: config)
picker.didFinishPicking { [unowned picker] items, cancelled in
if cancelled {
picker.dismiss(animated: true, completion: nil)
} else if let photo = items.singlePhoto {
let vc = NewInstructionsController()
vc.selectedImage = photo.modifiedImage ?? photo.image
vc.stepCount = self.stepCount
picker.pushViewController(vc, animated: true)
} else if let video = items.singleVideo {
video.fetchData(completion: { (data) in
let vc = NewInstructionsController()
// vc.selectedImage = video.thumbnail
vc.selectedVideo = data
vc.stepCount = self.stepCount
picker.pushViewController(vc, animated: true)
})
} else {
picker.dismiss(animated: true, completion: nil)
}
}
present(picker, animated: true, completion: nil)
}
On my second view I am just trying to call the video to display. I can get images to work but I need videos to play in a view that is located in the same area.
var selectedVideo: Data?
let instructionsVideo: UIView = {
let iv = UIView()
iv.layer.cornerRadius = 3
iv.contentMode = .scaleAspectFill
iv.clipsToBounds = true
iv.layer.masksToBounds = true
return iv
}()
How would I get my video that I recorded from my imagepicker to the next controller and it will display in a view that I have over my uiimageview? I wondered if anyone can help me please? Thanks