iMessage App Video Message volume not working
Asked Answered
M

2

10

I am sending video message in iMessage App using following code.

@IBAction func didPress() {
        if let conversation = activeConversation {
            if let filePath = Bundle.main.path(forResource: "small", ofType: ".mp4") {
                let filePathURL = NSURL.fileURL(withPath: filePath)

                let layout = MSMessageTemplateLayout()
                //layout.image = image
                layout.mediaFileURL = filePathURL

                let message = MSMessage()
                message.layout = layout

                //message.url = URL(string: "emptyURL")

                conversation.insert(message, completionHandler: { (error: NSError?) in
                    print(error as Any)

                    } as? (Error?) -> Void)

            }

        }
    }

When It appears in the message window it successfully plays the video with muted sound icon. When I tap the sound icon to open the volume it instead open the expanded View Controller.

Is this the iOS bug in iMessage App Extension?

Video with muted icon

View as a result of tap on muted icon

Merkley answered 26/7, 2017 at 8:41 Comment(0)
H
0

Is it not because of default layout? MSMessageTemplateLayout()

Have you tried custom layout?

Hashimoto answered 28/7, 2017 at 12:21 Comment(1)
MSMessageTemplateLayout can't be customized unfortunately. developer.apple.com/documentation/messages/… As documentation says "Do not subclass the MSMessageTemplateLayout class."Merkley
M
0

According to bug reporter You should use the insertAttachment API to insert MP3, WAV and M4a.

conversation.insertAttachment(fileUrl, withAlternateFilename: "fileAudio") { error in
        if let error = error {
            print(error)
        }
Milter answered 28/7, 2017 at 12:30 Comment(2)
The problem with insertAttachment is that it doesn't auto play the video once message is sent.Merkley
Can you send the link where this bug is reported?Merkley

© 2022 - 2024 — McMap. All rights reserved.