BCOVPlaybackService Class Reference

Inherits from NSObject
Declared in BCOVPlaybackService.h

Overview

The BCOVPlaybackService class provides asynchronous methods for retrieving information about videos from Brightcove’s Playback API.

  sharedURLSession

NSURLSession shared across all network calls to the BCOVPlaybackService. This object is created when the Playback Service is initialized. If you wish to use your own NSURLSession you can set it here. If set to nil, the default NSURLSession will be re-created.

@property (nonatomic, strong) NSURLSession *sharedURLSession

Discussion

NSURLSession shared across all network calls to the BCOVPlaybackService. This object is created when the Playback Service is initialized. If you wish to use your own NSURLSession you can set it here. If set to nil, the default NSURLSession will be re-created.

Declared In

BCOVPlaybackService.h

  watermarkingToken

The watermarking token for use with Forensic Watermarking

@property (nonatomic, copy) NSString *watermarkingToken

Discussion

The watermarking token for use with Forensic Watermarking

Declared In

BCOVPlaybackService.h

– initWithAccountId:policyKey:

Initializes a BCOVPlaybackService. It uses the accountId and policyKey to create a BCOVPlaybackServiceRequestFactory internally.

- (instancetype)initWithAccountId:(NSString *)accountId policyKey:(NSString *)policyKey

Parameters

accountId

Account Id to be used for each request. Must not be nil.

policyKey

PolicyKey to be used for each request. May be nil.

Return Value

An initialized instance.

Discussion

Initializes a BCOVPlaybackService. It uses the accountId and policyKey to create a BCOVPlaybackServiceRequestFactory internally.

If using the Edge Playback Service, the policyKey value should be nil

Declared In

BCOVPlaybackService.h

– initWithRequestFactory:

Initializes a BCOVPlaybackService with a required BCOVPlaybackServiceRequestFactory.

- (instancetype)initWithRequestFactory:(BCOVPlaybackServiceRequestFactory *)requestFactory

Parameters

requestFactory

Request Factory to use for creating URL requests.

Return Value

An initialized instance.

Discussion

Initializes a BCOVPlaybackService with a required BCOVPlaybackServiceRequestFactory.

Declared In

BCOVPlaybackService.h

– findPlaylistWithConfiguration:queryParameters:completion:

Retrieves a BCOVPlaylist from the Playback API service by its playlist ID on a background queue.

- (void)findPlaylistWithConfiguration:(NSDictionary *)configuration queryParameters:(NSDictionary *)queryParameters completion:(void ( ^ ) ( BCOVPlaylist *playlist , NSDictionary *jsonResponse , NSError *error ))completionHandler

Parameters

configuration

NSDictionary of configuration options used in this catalog request. Valid parameters are: kBCOVPlaybackServiceConfigurationKeyPlaylistID kBCOVPlaybackServiceConfigurationKeyPlaylistReferenceID kBCOVPlaybackServiceConfigurationKeyAuthToken kBCOVPlaybackServiceConfigurationKeyBumperID

queryParameters

Additional NSString query parameters to add to the Playback API requests. These values will override the default values if they conflict. Can use the kBCOVPlaybackServiceParameterKeyOffset and kBCOVPlaybackServiceParameterKeyLimit parameters. See “Playlist Paging” above.

completionHandler

block which will be invoked when the request finishes. Execution of the completionHandler will occur on the main thread.

Discussion

Retrieves a BCOVPlaylist from the Playback API service by its playlist ID on a background queue.

If the completionHandler provides an NSError, the BCOVPlaylist will be nil.

Declared In

BCOVPlaybackService.h

– findVideoWithConfiguration:queryParameters:completion:

Retrieves a BCOVVideo from the Playback API service by its video ID on a background queue.

- (void)findVideoWithConfiguration:(NSDictionary *)configuration queryParameters:(NSDictionary *)queryParameters completion:(void ( ^ ) ( BCOVVideo *video , NSDictionary *jsonResponse , NSError *error ))completionHandler

Parameters

configuration

NSDictionary of configuration options used in this catalog request. Valid parameters are: kBCOVPlaybackServiceConfigurationKeyVideoID kBCOVPlaybackServiceConfigurationKeyVideoReferenceID kBCOVPlaybackServiceConfigurationKeyAuthToken kBCOVPlaybackServiceConfigurationKeyBumperID

queryParameters

Additional NSString query parameters to add to the Playback API requests. These values will override the default values if they conflict.

completionHandler

block which will be invoked when the request finishes. Execution of the completionHandler will occur on the main thread.

Discussion

Retrieves a BCOVVideo from the Playback API service by its video ID on a background queue.

If the completionHandler provides an NSError, the BCOVVideo will be nil.

Declared In

BCOVPlaybackService.h

+ sourceFromJSONDictionary:

Initializes a source from the JSON dictionary. Properties that don’t map to first class properties on the source are added to the properties dictionary.

+ (BCOVSource *)sourceFromJSONDictionary:(NSDictionary *)json

Parameters

json

Dictionary representing the deserialized source.

Return Value

The initialized source.

Discussion

Initializes a source from the JSON dictionary. Properties that don’t map to first class properties on the source are added to the properties dictionary.

Declared In

BCOVPlaybackService.h

+ cuePointFromJSONDictionary:

Initializes a cue point from the JSON dictionary. Properties that don’t map to first class properties on cue point are added to the properties dictionary.

+ (BCOVCuePoint *)cuePointFromJSONDictionary:(NSDictionary *)json

Parameters

json

Dictionary representing the deserialized cuepoint.

Return Value

The initialized cue point.

Discussion

Initializes a cue point from the JSON dictionary. Properties that don’t map to first class properties on cue point are added to the properties dictionary.

Declared In

BCOVPlaybackService.h

+ playlistFromJSONDictionary:

Initializes a playlist from the JSON dictionary. Properties that don’t map to first class properties on playlist are added to the properties dictionary.

+ (BCOVPlaylist *)playlistFromJSONDictionary:(NSDictionary *)json

Parameters

json

Dictionary representing the deserialized playlist.

Return Value

The initialized playlist.

Discussion

Initializes a playlist from the JSON dictionary. Properties that don’t map to first class properties on playlist are added to the properties dictionary.

Declared In

BCOVPlaybackService.h

+ videoFromJSONDictionary:

Initializes a video from the JSON dictionary. Properties that don’t map to first class properties on video are added to the properties dictionary.

+ (BCOVVideo *)videoFromJSONDictionary:(NSDictionary *)json

Parameters

json

Dictionary representing the deserialized video.

Return Value

The initialized video.

Discussion

Initializes a video from the JSON dictionary. Properties that don’t map to first class properties on video are added to the properties dictionary.

Declared In

BCOVPlaybackService.h