[Bug][TwitterKit] Video is shared as an image

ios
api

#1

Hi,

My application keeps a list of video URLs stored in the iOS devices’ camera roll. They are shown in the app as video loops. The user can share any video loop through our custom video library.

In the past we used Apple’s API to upload to Twitter, and videos were shown correctly as videos. Unfortunately, iOS 11 will no longer support this.

When using the Twitter API instead, the following code only shares the video on twitter as an image, but not as a video.

NSURL* videoURL = [NSURL fileURLWithPath:@"/var/mobile/Media/DCIM/100APPLE/IMG_0249.MP4"];
TWTRComposerViewController* composer = [[TWTRComposerViewController alloc] initWithInitialText:@"Some text" image: nil videoURL:videoURL];

Why is the video converted to an image?

Thanks!


#2

The problem is that we are grabbing preview image but not properly attaching video.
Currently, TWTRComposerViewController only accepts reference URL (with scheme assets-library) from UIImagePicker, i.e. info(UIImagePickerControllerMediaURL).
We are planning to add media URL for video upload in next patch. Thank you!