Question

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

Was it helpful?

Solution

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];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top