We're happy to announce that we have updated the Brightcove App SDK for iOS to support sharing videos by e-mail and Twitter. The new version of our app SDK, version 2.0, has some new APIs. Go to Brightcove App SDK for iOS for links to the zip files that include the latest versions of the SDK classes, and reference docs. Let us know what you think in the Mobile SDK forum and please post your feature requests.
The BCSharingViewController class is part of the new libBrightcoveSharingKit.a library and provides an easy way to enable your viewers to e-mail or tweet links to your videos. It inherits from UIViewController and displays both options on a list view.
BCSharingViewController expects a BCVideo and a playerId as parameters. The BCVideo is usually retrieved with the Media API SDK while the playerId has to be the id of a web-accessible player created on the Brightcove Studio Publishing module.
Example:
#import"BCSharingViewController.h" // Available thru libBrightcoveSharingKit.a BCSharingViewController *bcsvc = [[BCSharingViewController alloc] init]; [bcsvc setVideo: self.video]; // Where video is an instance of BCVideo // Replace 000000000L with the player id created in the Publishing Module [bcsvc setSharingPlayerId: 000000000L]; [self.view addSubview:bcsvc.view];
The view that adds BCSharingViewController needs to implement the BCSharingViewDelegate. This delegate links the sharing view with a view controller in your app and offers control over some e-mail features. The methods that this delegate offers are:
- (UIViewController *)viewControllerToPresentEmailCompose {
return self;
}
- (BOOL)shouldAnimateEmailComposePresentation { return YES; }
- (BOOL) shouldExitApplicationToSendEmail {
return YES; }
We look forward to hearing what you implement with the Brightcove iOS SDK!