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?