IRIS.TV Brightcove Player Plugin for iOS

This is a framework used to incorporate IRIS.TV's AdaptiveStream video personalization engine into the Brightcove Video Player for iOS.

Release Notes

IMPORTANT:

If your application requires IRIS.TV's default AdaptiveStream workflow, please use Version 1.0.12 of this plugin. Versions 1.0.15 and above currently offer only the alternative Recommendation Slate workflow, used when displaying multiple upcoming video recommendations within the application's UI.


UPDATE - Version 1.1.0: Now references newer version of Brightcove SDK pod  (Brightcove-Player-Core), which subsequently deprecates the BCOVCatalogService and requires use of the BrightcovePlaybackService

Version 1.0.22: Brightcove iOS SDK can pass through IMA3 settings

Version 1.0.18: Video request errors from the Brightcove API are now handled via event listener handleVideoRequestErrorEvent

Version 1.0.17: The image_url data point has been reintroduced in the playlist

Version 1.0.16: Error handling for invalid video requests (see Notes section) New public function setContinuousPlay:(BOOL)contPlay to turn on/off continuous play upon completion of video playback

Version 1.0.15: * Added functionality for visibly displaying upcoming recommended videos

Version 1.0.12: Includes custom errors for offline use Constructor allows customization of the number of recommendations returned in each IRIS.TV API response

Version 1.0.11: * Plugin now loads video assets via whichever Brightcove API (Media Catalog or Playback Service) is specified in the IRIS Playback Controller constructor

Version 1.0.10: New public method getCurrentPlaylist to return all video objects in the playlist queueVideos are now loaded via the Brightcove Media API; previous versions used the video content URL

Version 1.0.9:

Version 1.0.8: Fixed event when scrubbing past 75% - sends more accurate behavior in milestone call Disabled previous button when viewing 1st video Removed duplicate videos with different iris_IDs but same platform_ID Other minor bug fixes

Installation

First, you must properly install CocoaPods: https://guides.cocoapods.org/using/getting-started.html

Then, after adding CocoaPods to your project using pod init, add the following lines to your Podfile:

use_frameworks!
platform :ios, ‘9.0’

Also add the following pods:

pod ‘Brightcove-Player-Core/dynamic’
pod ‘BCOVIRISTV’, :git => 'https://github.com/jbtv/iris_brightcove_ios_pod.git', :tag => ‘1.1.0’

Integration

The IRIS.TV Brightcove iOS Player plugin subclasses the Brightcove Player classes for easy integration with Brightcove’s current SDK.

To integrate into an app you must include the BCOVIRISTV.h header in file creating Brightcove Player. Beneath import statements, create strings representing a catalog token, your client token, and your IRIS access token. Also add strings representation for the video source URL and platformID:

#import <BCOVIRISTV/BCOVIRISTV.h>

// Customize these values with your own account information

// This is your IRIS provided ID, used to identify you as a client
static NSString * const kClientToken = @"yourClientToken";

// This is your Brightcove Cagalog Service Media API Token; required if using Brightcove Media API
static NSString * const kViewControllerCatalogToken = @"yourBrightcoveCatalogToken";

// This is your Brightcove Playback Service Policy Key; required if using Brightcove Playback API
static NSString * const kPolicyKey = @"yourBrightcovePlaybackServicePolicyKey";

// This is the URL to the video resource. You will need this if loading the initial video via URL
static NSString * const kVideoURL = @"yourVideoURL";

// This is your IRIS.TV API access token provided by IRIS
static NSString * const kIRISToken = @"yourIrisAccessToken";

// This is the video reference ID from the CMS
static NSString * const kPlatformID = @"yourVideoPlatformID";



To create Brightcove Player:

**Note that custom controls are not implicitly linked to the IRIS.TV methods. These methods are publically accessible and should be called manually corresponding to new controls:

(void)playPause;
  (void)playNext;
  (void)playPrev;
  (void)sliderTapped:(UIGestureRecognizer *)gestureRecognizer;
  (void)thumbsUp:(UIButton *)sender;
  (void)thumbsDown:(UIButton *)sender;


self.playbackController = [manager createIRISTVPlaybackControllerWithCatalogToken:kViewControllerCatalogToken
                                                                                  clientToken:kClientToken
                                                                                  accessToken:kIRISToken
                                                                                  imaSettings:imaSettings
                                                                                  adsRenderingSettings:yourAdsRenderingSettings
                                                                                  adsRequestPolicy:yourAdsRequestPolicy
                                                                                  adContainer:yourAdContainer
                                                                                  companionSlots:yourCompanionSlots];




NOTE: this method of creating a playback controller is now deprecated. See release notes above

BCOVCatalogService *catalog = [[BCOVcatalogService alloc] initWithToken:kViewControllerCatalogToken];
    [catalog findVideoWithVideoID:kPlatformID parameters:nil completion:^(BCOVVideo *video, NSDictionary *jsonResponse, NSError *error) {
        
        if (video)
        {
            [self.playbackController setVideos:@[ video ]];
        }
        else
        {
            NSLog(@"ViewController Debug - Error retrieving video: `%@`", error);
        }
        
    }];

OR

For more information about your policy key, see Brightcove's documentation on Policy Keys.

OR

If you choose to create the initial video using the source URL, please note that either a Media Catalog Token or a Playback Service Policy Key is still required for use of this plugin.


For an example on how to integrate this plugin, see: IrisBrightcoveExampleApp


Notes:

[NSException raise:@"NO_MORE_RECOMMENDATIONS" format:@"no new assets: /next response object is empty"];
[NSException raise:@"WATCH_CALL_FAILED" format:@"IRIS.TV API /watch call unsuccessful for initial video: %@", error.description];
[NSException raise:@"UPDATE_CALL_FAILED" format:@"IRIS.TV API /update call unsuccessful: %@", error.description];
[NSException raise:@"NEXT_CALL_FAILED" format:@"IRIS.TV API /next call unsuccessful: %@", error.description];

Please contact your IRIS.TV Account Executive for access to these GitHub repositories.



IRISTV Brightcove Player Plugin Architecture