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

– 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. Must not be nil.

Return Value

An initialized instance.

Discussion

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

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

– findPlaylistWithPlaylistID:parameters:completion:

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

- (void)findPlaylistWithPlaylistID:(NSString *)playlistID parameters:(NSDictionary *)parameters completion:(void ( ^ ) ( BCOVPlaylist *playlist , NSDictionary *jsonResponse , NSError *error ))completionHandler

Parameters

playlistID

The ID of the playlist to find.

parameters

Additional NSString query parameters to add to the Playback API requests. These values will override the default values if they conflict. Can use the “offset” and “limit” 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

– findPlaylistWithReferenceID:parameters:completion:

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

- (void)findPlaylistWithReferenceID:(NSString *)referenceID parameters:(NSDictionary *)parameters completion:(void ( ^ ) ( BCOVPlaylist *playlist , NSDictionary *jsonResponse , NSError *error ))completionHandler

Parameters

referenceID

The reference ID of the video to find.

parameters

Additional NSString query parameters to add to the Playback Can use the “offset” and “limit” parameters. See “Playlist Paging” above. 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 BCOVPlaylist from the Playback API service by its reference ID on a background queue.

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

Declared In

BCOVPlaybackService.h

– findVideoWithVideoID:parameters:completion:

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

- (void)findVideoWithVideoID:(NSString *)videoID parameters:(NSDictionary *)parameters completion:(void ( ^ ) ( BCOVVideo *video , NSDictionary *jsonResponse , NSError *error ))completionHandler

Parameters

videoID

The ID of the video to find.

parameters

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

– findVideoWithReferenceID:parameters:completion:

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

- (void)findVideoWithReferenceID:(NSString *)referenceID parameters:(NSDictionary *)parameters completion:(void ( ^ ) ( BCOVVideo *video , NSDictionary *jsonResponse , NSError *error ))completionHandler

Parameters

referenceID

The reference ID of the video to find.

parameters

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 reference 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