我想与YouTube
分享Facebook
中的UIActivityViewController
视频。
所以我创建UIActivityViewController
:
UIActivityViewController *activityViewController = [[UIActivityViewController alloc]
initWithActivityItems:activityItems applicationActivities:applicationActivities];
YouTubeAppDelegate *md = (YouTubeAppDelegate*)[[UIApplication sharedApplication] delegate];
[self presentViewController:activityViewController animated:YES completion:^{}];
我将YouTube链接添加到此。
但是,当我按下Facebook
中的UIActivityViewController
按钮时,会将其作为Facebook
中的文字发布,而不是嵌入视频播放器。
我知道如何解决它?
答案 0 :(得分:3)
NSArray * activityItems = @[[NSString stringWithFormat:@"Some initial text."], [NSURL URLWithString:@"http://www.youtube.com/watch?v=yyEWkJgdftE"]];
NSArray * applicationActivities = nil;
NSArray * excludeActivities = @[UIActivityTypeAssignToContact, UIActivityTypeCopyToPasteboard, UIActivityTypePostToWeibo, UIActivityTypePrint, UIActivityTypeMessage];
UIActivityViewController * activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities];
activityController.excludedActivityTypes = excludeActivities;
[self presentViewController:activityController animated:YES completion:nil];