gpt4 book ai didi

swift - iMessage 应用 Xcode

转载 作者:行者123 更新时间:2023-11-28 08:21:38 25 4
gpt4 key购买 nike

大家好,我尝试构建一个 iMessage 应用程序。我想发送视频。此视频来自 Http 服务器....

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)
}
}

你有什么建议?

最佳答案

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.

您只能使用 mediaFileURL 发送本地视频文件。我会尝试在事件 MSConversation 中使用 insertText(_:completionHandler:) 方法发送 View 的内联预览。

关于swift - iMessage 应用 Xcode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41142447/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com