I found out through StackOverflow that in IOS7 its possible to share Video to Facebook, twitter, Youtube.... through UIActivityController. I looked to find if someone has explained how to do it with video and nobody has(from what i found), or at least hasn't done a good job explaining it.

Is there any way to share Video through UIActivityViewController in ios7? It would be preferable if it was possible to choose the video from PhotoLibrary

有帮助吗?

解决方案

Not sure about choosing the video from the photo library but this works for sending video from an array

   NSString *videoPath = self.arrayVideoPaths[self.videoIndex];

    NSURL *data = [NSURL fileURLWithPath:videoPath];

    NSArray *activityItems = [NSArray arrayWithObjects:data, nil];

    UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];

    [self presentViewController:controller animated:YES completion:nil];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top