I've found that there are basically to way to add a video into an MSConversation
.
Create an
MSMessage
instance and add the file URL as themediaFileURL
property from theMSMessageTemplateLayout
let layout = MSMessageTemplateLayout() layout.imageTitle = caption layout.mediaFileURL = media layout.caption = nil layout.subcaption = nil layout.imageSubtitle = nil layout.subcaption = nil layout.trailingSubcaption = nil let message = MSMessage(session: session ?? MSSession()) message.layout = layout
Add it as an attachment using the method
insertAttachment(_:withAlternateFilename:completionHandler:)
The first one creates a preview of the video with the symbol of the message application and it starts automatically to play but with no sound, at the top left you can see a small icon of a speaker.
It doesn't seems to be a way to play the audio, because right after I click on the message it opens the Appstore or the same message application in expanded mode.
The latter sends correctly the video but it doesn't start automatically it is required for the user to press the play button over it.
Is there any way to make the video play with audio in the first case? or the only way is to open a specific view controller that plays the video once selected?