RBSDKPlayerViewControllerDelegate
@protocol RBSDKPlayerViewControllerDelegate <NSObject>
Using the RBSDKPlayerViewControllerDelegate
protocol, you can connect your
controllers with the player and comunicate betweem them.
-
Notifies that the player controller has loaded. This doesn’t means that the player is ready to play.
Declaration
Objective-C
- (void)playerControllerLoadDidSucceed:(BOOL)succeed withError:(nullable NSError *)error;
Swift
optional func playerControllerLoadDidSucceed(_ succeed: Any!, withError error: Any!)
Parameters
succeed
YES if the controller was able to load, NO if not i.e. the moment doesn’t exist.
error
If succeed is NO, then will contain a error.
-
Notifies that the player controller is ready to Play. This means that the player first track (angle at position 0) is ready to play.
Declaration
Objective-C
- (void)playerControllerIsReadyToPlay;
Swift
optional func playerControllerIsReadyToPlay()
-
Notifies the video on screen did switch to a new one. The player call this delegate method to inform the switch direction and the new media information.
Declaration
Objective-C
- (void)playerControllerDidSwitchDirection: (RBSDKPlayerContentDirection)contentDirection media: (nonnull RBSDKPlayerMediaInfo *)media;
Swift
optional func playerControllerDidSwitchDirection(_ contentDirection: Any!, media: RBSDKPlayerMediaInfo!)
Parameters
contentDirection
Switch content direction.
media
The media information.
-
Notifies the player has changed the playing status. The player call this delegate method to inform the new playing status information.
Declaration
Objective-C
- (void)playerControllerDidChangePlayingStatus:(BOOL)isPlaying;
Swift
optional func playerControllerDidChangePlayingStatus(_ isPlaying: Any!)
Parameters
isPlaying
Current player playing status
-
Override the desired color on the player’s controls and other UI
Declaration
Objective-C
- (nonnull UIColor *)playerControllerColor;
Swift
optional func playerControllerColor() -> Any!
Return Value
desired color
-
Notifies the player current media watched time. The player call this delegate to report watched time of the current media showing. Watched Time is the total time that the media is playing and focused on view.
Declaration
Objective-C
- (void)playerControllerCurrentMedia:(nonnull RBSDKPlayerMediaInfo *)media watchedTime:(float)watchedTime;
Swift
optional func playerControllerCurrentMedia(_ media: RBSDKPlayerMediaInfo!, watchedTime: Float)
Parameters
media
Media information
watchedTime
Total watched time
-
Notifies the player did change the fullscreen status. The player call this delegate method to inform the fullscreen status information.
Declaration
Objective-C
- (void)playerControllerDidChangeFullscreenStatus;
Swift
optional func playerControllerDidChangeFullscreenStatus()
-
Notifies the player will change the fullscreen status. The player call this delegate method to inform the fullscreen status information.
Declaration
Objective-C
- (void)playerControllerWillChangeFullscreenStatus;
Swift
optional func playerControllerWillChangeFullscreenStatus()
-
Notifies the player will reach the end of the player content at direction.
@discussion If this delegate is added, all the content loading (vertical or horizontal) won’t be automatically added by the Rhinobird Api Itself. This means, this should be manually done trough the playerController methods at the SDK to add content in the end.
Declaration
Objective-C
- (void)playerControllerWillReachEnd: (RBSDKPlayerContentDirection)contentDirection completionHandler:(nonnull void (^)(void))completionHandler;
Swift
optional func playerControllerWillReachEnd(_ contentDirection: Any!, completionHandler: (() -> Void)!)
Parameters
contentDirection
Content direction.
completionHandler
Call after updating the content.
-
Notifies the player is showing controls. The player call this delegate method to notify the controls visibility (show/hide).
Declaration
Objective-C
- (void)playerControllerShowingControls:(BOOL)showingControls;
Swift
optional func playerControllerShowingControls(_ showingControls: Any!)
Parameters
showingControls
YES if is showing controls at the moment, No if the controls are hide.