iOS | Video play
What is proper way to play uploaded video using iOS SDK?
I was trying to pass URL from message.attachment?.url object but this always refuse with message
No authorization token was found
I figgured out by myself.
First I had to save data into URL
let tmpFileURL = URL(fileURLWithPath:NSTemporaryDirectory()).appendingPathComponent(message.attachment!.fileName ?? "video")
let wasFileWritten = (try? message.attachment!.data!.write(to: tmpFileURL, options: [.atomic])) != nil
And then I could pass that URL into VideoPlayer from AVKit.
Vous devez vous connecter pour laisser un commentaire.