最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

swiftui - Is there documentation on requirements for ShareLinking movies to social sites? - Stack Overflow

programmeradmin0浏览0评论

I have a SwiftUI app that allows the user to record a movie and passes that to a ShareLink:

struct MovieTransferable: Transferable {
    
    let url: URL
    let writeMovie: (URL) -> ()
    
    static var transferRepresentation: some TransferRepresentation {
        FileRepresentation(
            exportedContentType: .movie,
            exporting: {
                (movie) in
                    
                    // Write the movie into documents.
                    movie.writeMovie(movie.url)

                    return SentTransferredFile(movie.url)
            })
    }
}

This works for saving the file to Photos, air dropping, and some app share links. However, some apps (looking at you discord), look like they are going to accept the movie, but don't post the movie itself (just the comment). Currently, I'm writing out an h264 quicktime at 30fps using AVKit. The aspect ratio of the movie is the user's screen, so the width/height of the movie is a little odd.

Posting an image works great to all apps.

I'm wondering if it is the codec or maybe something else about the movie that causes the ShareLink apps to reject the movie. Is there documentation anywhere that talks about the expected compatibility of QuickTimes for ShareLink?

发布评论

评论列表(0)

  1. 暂无评论