BCOVPlaybackControllerBasicDelegate Protocol Reference

Conforms to NSObject
Declared in BCOVPlaybackController.h

Overview

Conform to this protocol to receive basic playback information for each session.

– playbackController:didAdvanceToPlaybackSession:

Called when the controller advances to a new playback session, which happens when -advanceToNext is called. When a delegate is set on a playback controller, this method is called with the most recently advanced-to playback session (where applicable).

- (void)playbackController:(id<BCOVPlaybackController>)controller didAdvanceToPlaybackSession:(id<BCOVPlaybackSession>)session

Parameters

controller

The playback controller receiving the new session.

session

The playback session that was advanced.

Discussion

Called when the controller advances to a new playback session, which happens when -advanceToNext is called. When a delegate is set on a playback controller, this method is called with the most recently advanced-to playback session (where applicable).

Declared In

BCOVPlaybackController.h

– playbackController:playbackSession:didChangeDuration:

Called when a playback session’s duration is updated. When a delegate is set on a playback controller, this method is called with the most recently updated duration for the session. A session duration can change as the media playback continues to load, as it is refined with more precise information.

- (void)playbackController:(id<BCOVPlaybackController>)controller playbackSession:(id<BCOVPlaybackSession>)session didChangeDuration:(NSTimeInterval)duration

Parameters

controller

The playback controller to which this instance serves as delegate.

session

The playback session whose duration changed.

duration

The most recently updated session duration.

Discussion

Called when a playback session’s duration is updated. When a delegate is set on a playback controller, this method is called with the most recently updated duration for the session. A session duration can change as the media playback continues to load, as it is refined with more precise information.

Declared In

BCOVPlaybackController.h

– playbackController:playbackSession:didChangeExternalPlaybackActive:

Called when a playback session’s external playback active status is updated. When a delegate is set on a playback controller, this method is called with the current external playback active status for the session.

- (void)playbackController:(id<BCOVPlaybackController>)controller playbackSession:(id<BCOVPlaybackSession>)session didChangeExternalPlaybackActive:(BOOL)externalPlaybackActive

Parameters

controller

The playback controller to which this instance serves as delegate.

session

The playback session whose external playback status changed.

externalPlaybackActive

Whether external playback is active.

Discussion

Called when a playback session’s external playback active status is updated. When a delegate is set on a playback controller, this method is called with the current external playback active status for the session.

Declared In

BCOVPlaybackController.h

– playbackController:playbackSession:didPassCuePoints:

Called when a session’s playhead passes cue points registered with its video. This will occur regardless of whether the playhead passes the cue point time for standard progress (playback), or seeking (forward or backward) through the media. When a delegate is set on a playback controller, this method will only be called for future cue point events (any events that have already occurred will not be reported).

- (void)playbackController:(id<BCOVPlaybackController>)controller playbackSession:(id<BCOVPlaybackSession>)session didPassCuePoints:(NSDictionary *)cuePointInfo

Parameters

controller

The playback controller to which this instance serves as delegate.

session

The playback session whose cue points were passed.

cuePointInfo

A dictionary of information about the cue point event.

Discussion

Called when a session’s playhead passes cue points registered with its video. This will occur regardless of whether the playhead passes the cue point time for standard progress (playback), or seeking (forward or backward) through the media. When a delegate is set on a playback controller, this method will only be called for future cue point events (any events that have already occurred will not be reported).

If multiple cue points are registered to a time or times that fall between the “previous time” and “current time” for a cue point event, all cue points after the “previous time” and before or on “current time” will be included in the cue point collection. Put differently, multiple cue points at the same time are aggregated into a single cue point event whose collection will contain all of those cue points. The most likely scenario in which this would happen is when seeking across a time range that includes multiple cue points (potentially at different times) – this will result in a single cue point event whose previous time is the point at which seek began, whose current time is the destination of the seek, and whose cue points are all of the cue points whose time fell within that range.

The cuePointInfo dictionary will contain the following keys and values for each cue point event:

kBCOVPlaybackSessionEventKeyPreviousTime: the progress interval immediately preceding the cue points for which this event was received. kBCOVPlaybackSessionEventKeyCurrentTime: the progress interval on or immediately after the cue points for which this event was received. kBCOVPlaybackSessionEventKeyCuePoints: the BCOVCuePointCollection of cue points for which this event was received.

Declared In

BCOVPlaybackController.h

– playbackController:playbackSession:didProgressTo:

Called with the playback session’s playback progress. As the session’s media plays, this method is called periodically with the latest progress interval. When a delegate is set on a playback controller, this method will only be called with progress information that has not yet occurred.

- (void)playbackController:(id<BCOVPlaybackController>)controller playbackSession:(id<BCOVPlaybackSession>)session didProgressTo:(NSTimeInterval)progress

Parameters

controller

The playback controller to which this instance serves as delegate.

session

The playback session making progress.

progress

The time interval of the session’s current playback progress.

Discussion

Called with the playback session’s playback progress. As the session’s media plays, this method is called periodically with the latest progress interval. When a delegate is set on a playback controller, this method will only be called with progress information that has not yet occurred.

Declared In

BCOVPlaybackController.h

– playbackController:didCompletePlaylist:

Called when the end of the video playlist has been reached, after the the last video (including post-rolls) has played to the end. Only called when autoAdvance is set to YES on the playback controller.

- (void)playbackController:(id<BCOVPlaybackController>)controller didCompletePlaylist:(id<NSFastEnumeration>)playlist

Parameters

controller

The playback controller to which this instance serves as delegate.

playlist

The list of BCOVVideo objects that were played. Do not assume that this is an NSArray.

Discussion

Called when the end of the video playlist has been reached, after the the last video (including post-rolls) has played to the end. Only called when autoAdvance is set to YES on the playback controller.

Declared In

BCOVPlaybackController.h

– playbackController:playbackSession:didReceiveLifecycleEvent:

Called when a playback session receives a lifecycle event. This method is called only for lifecycle events that occur after the delegate is set (previous lifecycle events will not be buffered/delivered to the delegate).

- (void)playbackController:(id<BCOVPlaybackController>)controller playbackSession:(id<BCOVPlaybackSession>)session didReceiveLifecycleEvent:(BCOVPlaybackSessionLifecycleEvent *)lifecycleEvent

Parameters

controller

The playback controller to which this instance serves as delegate.

session

The playback session whose lifecycle events were received.

lifecycleEvent

The lifecycle event received by the session.

Discussion

Called when a playback session receives a lifecycle event. This method is called only for lifecycle events that occur after the delegate is set (previous lifecycle events will not be buffered/delivered to the delegate).

The lifecycle event types are listed along with the BCOVPlaybackSessionLifecycleEvent class.

Declared In

BCOVPlaybackController.h

– playbackController:playbackSession:didChangeSeekableRanges:

Called when a playback session’s seekable ranges is updated. When a delegate is set on a playback controller, this method is called with the most recently updated seekable ranges for the session. A session seekable ranges can change as the media playback continues to load.

- (void)playbackController:(id<BCOVPlaybackController>)controller playbackSession:(id<BCOVPlaybackSession>)session didChangeSeekableRanges:(NSArray *)seekableRanges

Parameters

controller

The playback controller to which this instance serves as delegate.

session

The playback session whose seekable ranges changed.

seekableRanges

An array of NSValue about the most recently updated session seekableRanges.

Discussion

Called when a playback session’s seekable ranges is updated. When a delegate is set on a playback controller, this method is called with the most recently updated seekable ranges for the session. A session seekable ranges can change as the media playback continues to load.

Declared In

BCOVPlaybackController.h

– playbackController:noPlayableVideosFound:

Called when the playback controller can find no playable videos when videos are passed into the playback controller’s setVideos: method

- (void)playbackController:(id<BCOVPlaybackController>)controller noPlayableVideosFound:(id<NSFastEnumeration>)unplayableVideos

Parameters

controller

The playback controller to which this instance serves as delegate.

unplayableVideos

The videos that were passed into the setVideos: method

Discussion

Called when the playback controller can find no playable videos when videos are passed into the playback controller’s setVideos: method

Declared In

BCOVPlaybackController.h

– playbackController:determinedMetadata:forVideo:

Called when the metadata have been determined for the current video.

- (void)playbackController:(id<BCOVPlaybackController>)controller determinedMetadata:(NSDictionary<NSString*,NSString*> *)metadata forVideo:(BCOVVideo *)video

Parameters

controller

The playback controller to which this instance serves as delegate.

metadata

The dictionary containing key-value pairs of the metadata.

video

The video which has had its metadata determined.

Discussion

Called when the metadata have been determined for the current video.

The metadata will be determined after kBCOVPlaybackSessionLifecycleEventReady has been received for the session using the device locale.

Declared In

BCOVPlaybackController.h

– playbackController:determinedVideoType:forVideo:

Called when the video type has been determined for the current video.

- (void)playbackController:(id<BCOVPlaybackController>)controller determinedVideoType:(BCOVVideoType)videoType forVideo:(BCOVVideo *)video

Parameters

controller

The playback controller to which this instance serves as delegate.

videoType

The determined video type.

video

The video which has had its type determined.

Discussion

Called when the video type has been determined for the current video.

The video type will be determined after kBCOVPlaybackSessionLifecycleEventReady has been received for the session.

You can use the returned videoType to determine which BCOVPUIControlLayout to utilize on the current BCOVPUIPlayerView. This can be helpful for dynamically switching between control layouts if utilizing different video types in a playlist.

The value can be one of the following: - BCOVVideoTypeVOD - BCOVVideoTypeLive - BCOVVideoTypeLiveDVR - BCOVVideoTypeUnknown

Declared In

BCOVPlaybackController.h

– playbackController:determinedCodecs:forVideo:

Called when the codecs have been determined for the current video.

- (void)playbackController:(id<BCOVPlaybackController>)controller determinedCodecs:(NSArray<NSString*> *)codecs forVideo:(BCOVVideo *)video

Parameters

controller

The playback controller to which this instance serves as delegate.

codecs

The array containing NSString values of the codecs used for the video

video

The video which has had its codecs determined.

Discussion

Called when the codecs have been determined for the current video.

The codecs will be determined after kBCOVPlaybackSessionLifecycleEventReady has been received for the session.

Declared In

BCOVPlaybackController.h

– playbackController:playbackSession:determinedMediaType:

Called when the media type of a source has been determined.

- (void)playbackController:(id<BCOVPlaybackController>)controller playbackSession:(id<BCOVPlaybackSession>)session determinedMediaType:(BCOVSourceMediaType)mediaType

Parameters

controller

The playback controller to which this instance serves as delegate.

session

The playback session whose AVPlayer’s currentItem’s media option was changed

mediaType

The media type that was determined

Discussion

Called when the media type of a source has been determined.

MP4 sources will always be marked as BCOVSourceMediaTypeAudioVideo.

Declared In

BCOVPlaybackController.h

– playbackController:playbackSession:didChangeSelectedAudibleMediaOption:

Called when a new audible AVMediaSelectionOption is set on the current BCOVPlaybackSession which can be done using BCOVPUIPlayerView or BCOVTVPlayerView, or by calling the AVMediaSelectionOption setter methods of BCOVPlaybackSession.

- (void)playbackController:(id<BCOVPlaybackController>)controller playbackSession:(id<BCOVPlaybackSession>)session didChangeSelectedAudibleMediaOption:(AVMediaSelectionOption *)audibleMediaOption

Parameters

controller

The playback controller to which this instance serves as delegate.

session

The playback session whose AVPlayer’s currentItem’s media option was changed

audibleMediaOption

The newly selected AVMediaSelectionOption

Discussion

Called when a new audible AVMediaSelectionOption is set on the current BCOVPlaybackSession which can be done using BCOVPUIPlayerView or BCOVTVPlayerView, or by calling the AVMediaSelectionOption setter methods of BCOVPlaybackSession.

Declared In

BCOVPlaybackController.h

– playbackController:playbackSession:didChangeSelectedLegibleMediaOption:

Called when a new legible AVMediaSelectionOption is set on the current BCOVPlaybackSession which can be done using BCOVPUIPlayerView or BCOVTVPlayerView, or by calling the AVMediaSelectionOption setter methods of BCOVPlaybackSession.

- (void)playbackController:(id<BCOVPlaybackController>)controller playbackSession:(id<BCOVPlaybackSession>)session didChangeSelectedLegibleMediaOption:(AVMediaSelectionOption *)legibleMediaOption

Parameters

controller

The playback controller to which this instance serves as delegate.

session

The playback session whose AVPlayer’s currentItem’s media option was changed

legibleMediaOption

The newly selected AVMediaSelectionOption

Discussion

Called when a new legible AVMediaSelectionOption is set on the current BCOVPlaybackSession which can be done using BCOVPUIPlayerView or BCOVTVPlayerView, or by calling the AVMediaSelectionOption setter methods of BCOVPlaybackSession.

Declared In

BCOVPlaybackController.h

– playbackController:playbackSession:didReachMaxConcurrency:

Called when the maximum concurrency limit is reached. This method will only be called when streamConcurrencyEnabled is set to YES.

- (void)playbackController:(id<BCOVPlaybackController>)controller playbackSession:(id<BCOVPlaybackSession>)session didReachMaxConcurrency:(NSDictionary *)sessions

Parameters

controller

The playback controller to which this instance serves as delegate.

session

The playback session whose AVPlayer’s currentItem’s media option was changed.

sessions

An NSDictionary containing the active sessions for the current user and account.

Discussion

Called when the maximum concurrency limit is reached. This method will only be called when streamConcurrencyEnabled is set to YES.

Declared In

BCOVPlaybackController.h

– playbackServiceForManifestURLTTLUpdateForPlaybackController:playbackSession:

Called when the TTL token for the current source’s manifest has expired and needs to be refreshed. You will want to implement this delegate method if you are using a BCOVPlaybackService with a custom URL.

- (BCOVPlaybackService *)playbackServiceForManifestURLTTLUpdateForPlaybackController:(id<BCOVPlaybackController>)controller playbackSession:(id<BCOVPlaybackSession>)session

Parameters

controller

The playback controller to which this instance serves as delegate.

session

The playback session whose AVPlayer’s currentItem’s media option was changed

Return Value

An instance of BCOVPlaybackService that will be used to update the manifest TTL token.

Discussion

Called when the TTL token for the current source’s manifest has expired and needs to be refreshed. You will want to implement this delegate method if you are using a BCOVPlaybackService with a custom URL.

If you are using the default initilaizer for BCOVPlaybackService, initWithAccountId:policyKey: you do not need to implement this delegate method.

If you return nil, or do not implement this method, an instance of BCOVPlaybackService will be created internally with the initWithAccountId:policyKey: initializer.

Declared In

BCOVPlaybackController.h

– manifestTTLWasUpdatedWithError:playbackController:playbackSession:

Called after the TTL token for the current source’s manifest has attempted to be updated.

- (void)manifestTTLWasUpdatedWithError:(NSError *)error playbackController:(id<BCOVPlaybackController>)controller playbackSession:(id<BCOVPlaybackSession>)session

Parameters

error

If the update was successful this will be nil, otherwise the error encountered will be accessible here

controller

The playback controller to which this instance serves as delegate.

session

The playback session whose AVPlayer’s currentItem’s media option was changed

Discussion

Called after the TTL token for the current source’s manifest has attempted to be updated.

Declared In

BCOVPlaybackController.h

– playbackController:didInsertVideo:atIndex:

Called after a video has been successfully inserted into the player queue.

- (void)playbackController:(id<BCOVPlaybackController>)controller didInsertVideo:(BCOVVideo *)video atIndex:(NSUInteger)index

Parameters

controller

The playback controller to which this instance serves as delegate.

video

The video that was inserted.

index

The index at which the newVideo was inserted.

Discussion

Called after a video has been successfully inserted into the player queue.

Declared In

BCOVPlaybackController.h

– playbackController:failedToInsertVideo:

Called if a video fails to be inserted into the player queue. Possible reasons are: - AVQueuePlayer returning false for canInsertItem:afterItem - Failure to pass in a valid BCOVVideo into the insertVideo:afterVideoAtIndex: method - The session created for the BCOVVideo resulted in a BCOVErrorSession

- (void)playbackController:(id<BCOVPlaybackController>)controller failedToInsertVideo:(BCOVVideo *)video

Parameters

controller

The playback controller to which this instance serves as delegate.

video

The video that failed to be inserted.

Discussion

Called if a video fails to be inserted into the player queue. Possible reasons are: - AVQueuePlayer returning false for canInsertItem:afterItem - Failure to pass in a valid BCOVVideo into the insertVideo:afterVideoAtIndex: method - The session created for the BCOVVideo resulted in a BCOVErrorSession

Declared In

BCOVPlaybackController.h