I was able to embed a video into an MSMessage instance and send it only problem is the audio is automatically muted. You can see that its muted by a little speaker crossed out on the top right of the message bubble. I've also tried it on my iphone without silence, still no sound.
let message = MSMessage()
let layout = MSMessageTemplateLayout()
layout.caption = "Titans music video"
let filePath =
Bundle.main.path(forResource: "TitansVideo", ofType: "mov")
let fileUrl = NSURL(fileURLWithPath: filePath!)
let URL = fileUrl as URL
layout.mediaFileURL = URL
message.layout = layout
let conversation = self.activeConversation
conversation?.insert(message, completionHandler: {(error) in
if let error = error {
print(error)
}
})
I've tried using different video files to no avail. I can't find much information on this and i'm beginning to think Apple doesn't want the audio to be enabled. Which is weird since in the ios 10 WWDC you can similarly send youtube videos in iMessage that play Audio/Video in the message bubble.