I am completely new to Parse Platform. Im trying load video from parse server hosted on heroku using mongoLab to store data.
I have a video as PFFile in database and I can fetch it in my iOS app too as a PFFileObject. But I can't find any leads how to load / extract video data or url from PFFileObject.
To be more specific, I want to play this video in table view cell with AVPlayer / AVPlayerLayer.
let file = self.pastWinnersData[0].value(forKey: "video") as AnyObject
if let parseFile = file as? PFFileObject {
let query = PFQuery(className: "Winner")
query.getObjectInBackground(withId: parseFile ) { object, error in
if (error == nil && object != nil) {
let videoFile = object!["keyForVideoPFFile"] as! PFFileObject
self.videoURL = videoFile.url!
}
}
I tried above code but I don't understand
query.getObjectInBackground(withId: STRING_VALUE )
what id should I pass at
STRING_VALUE
I have gone through
https://stackoverflow.com/questions/35235340/ios-cant-stream-video-from-parse-backend
these are kind on same question but can't find solutions useful.