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])) != nilAnd then I could pass that URL into VideoPlayer from AVKit.
Please sign in to leave a comment.
Comments
2 comments