JWPlayerViewControllerUIDelegate
@objc
public protocol JWPlayerViewControllerUIDelegate
UI events within the JWPlayerViewController are routed to this delegate.
-
Called when the control bar is done hiding or showing itself.
Declaration
Swift
func playerViewController(_ controller: JWPlayerViewController, controlBarVisibilityChanged isVisible: Bool, frame: CGRect)
Parameters
controller
The JWPlayerViewController emitting the event.
isVisible
true, if the control bar has finished showing itself. false if it has finished hiding itself.
frame
The frame of the visible control bar. If the control bar is not visible, CGRect.zero is returned.
-
Called when the player’s dimensions have changed.
Declaration
Swift
func playerViewController(_ controller: JWPlayerViewController, sizeChangedFrom oldSize: CGSize, to newSize: CGSize)
Parameters
controller
The JWPlayerViewController emitting the resize event.
oldSize
The previous size of the player.
newSize
The new size of the player on the screen.
-
This method is triggered when the player is tapped. It is not triggered if the user tapped a button or other user interface element.
Declaration
Swift
func playerViewController(_ controller: JWPlayerViewController, screenTappedAt position: CGPoint)
Parameters
controller
The JWPlayerViewController emitting the event.
position
A position within the JWPlayerView that was tapped.