Brightcove App SDK for iOS: Version 2.0 with Email and Twitter sharing support

Technology
Media API
Required
Media API token
Edition
Express 499, Pro, Enterprise

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. 

New features in version 2.0.0:

  • Sharing UIs, e-mail and Twitter sharing are supported in the new library libBrightcoveSharingKit.a.

Changes in version 2.0.0

  • libBrightcoveiPadiPhoneKit.a has been renamed to libBrightcovePlayerKit.a
  • When an app selects a rendition, it now sorts your available renditions by encoding rate. It then selects the highest bit-rate rendition that is within the threshold you set.
  • The Stream Complete event is now sent to Brightcove at the end of a video.  
  • The logging property has moved to the BCConfigManager class from the BCMediaAPI class. The logging output is the same; the flag has just moved.
  • SBJSON header files are now public and available in the same header search path as our Media API headers.

E-mail and Twitter Sharing with BCSharingViewController 

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];

Adding a Delegate for BCSharingViewController

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:

  • viewControllerToPresentEmailCompose. Connects the in-app e-mail view with a view controller on your app. Example:
    - (UIViewController *)viewControllerToPresentEmailCompose {
        return self;
    }
  • shouldAnimateEmailComposePresentation. Indicates if an animation should be played when the e-mail view opens. Example:
    - (BOOL)shouldAnimateEmailComposePresentation {
        return YES;
    }
  • shouldExitApplicationToSendEmail. This is an optional method that indicates if the external e-mail should be used instead of in-app e-mail. Although most developers are choosing to use in-app e-mail, we wanted to offer the  flexibility to exit your app to send e-mail for backwards compatibility with existing apps. You do not need to override this method; the default is to use in-app e-mail.
        - (BOOL) shouldExitApplicationToSendEmail {
           return YES;     }
    
  • closeSharingView. This allows executing a task once the sharing view is closed. For example, you can apply an animation when the sharing view closes. 

We look forward to hearing what you implement with the Brightcove iOS SDK!