I am trying to use TWTRComposerViewController to share a video to twitter. The videos resolution 540x960 and they are about 3-4 seconds. There is no problem to share images, but when I share video nothing happens and the app would not respond anymore. I use the following code:
private func presentTWTRComposerViewController(withInitialText initialText: String, image: UIImage?, videoUrl: URL?, presentingViewController: UIViewController)
{
var composer: TWTRComposerViewController?
if let videoUrl = videoUrl
{
composer = TWTRComposerViewController(initialText: initialText, image: nil, videoURL: videoUrl)
}
else
{
composer = TWTRComposerViewController(initialText: initialText, image: image, videoURL: nil)
}
presentingViewController.present(composer!, animated: true)
}
I also tried using h264 and h265 videos and got the same results. I tried to reduce the size of the video to around 200x300 and also got the same results. What might be the issue?