SVSContentPlayerPlayHead
Objective-C
@protocol SVSContentPlayerPlayHead <NSObject>
Swift
protocol SVSContentPlayerPlayHead : NSObjectProtocol
Protocol used to describe the state of a content player.
Implement this protocol to allow your SVSAdManager instance to know the current state of the content player. The Playhead will allow the SVSAdManager to load and start ads at the right time and to configure the ad player depending on the configuration of the content player.
Warning
Every methods of this protocol are required and must be implemented to play ads!-
Returns the current time of the content player.
Declaration
Objective-C
- (NSTimeInterval)contentPlayerCurrentTime;
Swift
func contentPlayerCurrentTime() -> TimeInterval
Return Value
The current time of the content player.
-
Returns the total time of the media loaded in the content player.
This time can be equal to the constant kSVSContentPlayerTotalDurationStillUnknown if it is not known yet (ie: the content is still loading), or equal to kSVSContentPlayerTotalDurationInfinite when the content player is displaying a stream.
Declaration
Objective-C
- (NSTimeInterval)contentPlayerTotalTime;
Swift
func contentPlayerTotalTime() -> TimeInterval
Return Value
The total time of the media loaded in the content player.
-
Returns the volume of the content player (floating point number between 0.0 and 1.0).
This value will be used to set the volume of the Ad Player when starting an Ad Break.
Declaration
Objective-C
- (float)contentPlayerVolumeLevel;
Swift
func contentPlayerVolumeLevel() -> Float
Return Value
The volume of the content player.
-
Returns whether or not the content player is playing. Should return NO when the content player is paused or stopped
Declaration
Objective-C
- (BOOL)contentPlayerIsPlaying;
Swift
func contentPlayerIsPlaying() -> Bool
Return Value
Whether or not the content player is playing.