iMessage App Xcode

288 views Asked by At

Hy Guys, I try to build an iMessage App. I would like to Video send. This video coming from Http Server....

import UIKit
import Messages

class MessagesViewController: MSMessagesAppViewController {

 @IBAction func bt3(_ sender: UIButton) {
        //VIDEO URL
        let videoUrl = URL(string: "https://---/app/test/test.m4v")

        let message = MSMessage()
        message.shouldExpire = false

        let layout = MSMessageTemplateLayout()
        layout.mediaFileURL = videoUrl

        message.layout = layout

        let conversation = activeConversation
        conversation?.insert(message, completionHandler: nil)
  }
}

what do you recommend?

1

There are 1 answers

0
Matthew Barker On

mediaFileURL Documentation:

The media file URL must be a file URL. For video files, the system crops the left and right edges of the media file by 6 points, and rounds its corners. For audio files, it shows a graphical representation of the audio’s waveform.

You can only use mediaFileURL to send local video files. I'd try using the insertText(_:completionHandler:) method in the active MSConversation to send an inline preview of the view.