AmpPlayerManager
public class AmpPlayerManager: NSObject, PlayerEventObserver
Class in charge of exposing the player related functionality.
-
The AmpPlayer being managed
Declaration
Swift
public var ampPlayer: AmpPlayer?
-
The frame used to create the player view.
Declaration
Swift
public var playerFrame: CGRect
-
The view where the videos are going to be played.
Declaration
Swift
public var playerView: AmpPlayerView?
-
Declaration
Swift
public var fullscreenFrame: CGRect
-
Initializes a new AmpPlayerManager with the parameters provided.
Declaration
Swift
public init(ampPlayer: AmpPlayer, parentView: UIView, playerFrame: CGRect)
Parameters
parentView
The view where the player view is going to be added.
playerFrame
The bounds of the player view.
fullscreenFrame
The bounds of the player view when on fullscreen.
Return Value
A configured instance of an AmpPlayerManager.
-
Returns whether the player is in fullscreen or not.
Declaration
Swift
public func isFullscreen() -> Bool
Return Value
Whether the player is in fullscreen or not.
-
Handles the logic for sending the player’s view to fullscreen.
Declaration
Swift
public func enterFullscreen(orientationChanged: Bool = false)
-
Handles the logic for sending the player’s view to the origin frame.
Declaration
Swift
public func exitFullscreen()
-
Callback to detect the player orientation changed
Declaration
Swift
public func orientationChanged()
-
Callback on player view is tapped - parameter tap: UITapGestureRecognizer
Declaration
Swift
public func tap(sender: UITapGestureRecognizer?)
Parameters
tap
UITapGestureRecognizer
-
Callback on player view is doubleTapped - parameter tap: UITapGestureRecognizer
Declaration
Swift
public func doubleTap(sender: UITapGestureRecognizer?)
Parameters
tap
UITapGestureRecognizer
-
Callback to detect when player is roated
Declaration
Swift
public func rotated()
-
Stops the player being managed and the view linked to it.
Declaration
Swift
public func stop()
-
Enable Debug Mode - parameter enabled: Boolean true or false - parameter colored: Boolean true or false you must have the plugin Xcode Colors
Declaration
Swift
public func enableLogs(enabled:Bool, colored:Bool = false)
Parameters
enabled
Boolean true or false
colored
Boolean true or false you must have the plugin Xcode Colors