AmpPlayerManager

public class AmpPlayerManager: NSObject

Class in charge of exposing the player related functionality.

  • The AmpPlayer being managed

    Declaration

    Swift

    public var ampPlayer: AmpPlayer!
  • The view where the videos are going to be played.

    Declaration

    Swift

    public var playerView: AmpPlayerView!
  • The config reference for the player

    Declaration

    Swift

    public var playerConfig: AmpConfig!
  • Initializes a new AmpPlayerManager with the parameters provided.

    Declaration

    Swift

    public init(parentView: UIView, playerFrame: CGRect)

    Parameters

    playerFrame

    The bounds of the player view.

    parentView

    The view where the player view is going to be added.

    Return Value

    A configured instance of an AmpPlayerManager.

  • Setups the player and starts handling the url given.

    Declaration

    Swift

    public func setupPlayerWithUrl(url: String)

    Parameters

    url

    The url of the stream that should be played.

  • Setups the player with a config file.

    Declaration

    Swift

    public func setupPlayerWithUrl(url: String, chromeCastConfig:Bool)

    Parameters

    url

    The url of the stream that should be played.

    chromeCastConfig

    set true or false to determinate if the config file is for chromecast or not

  • Plays a url

    Declaration

    Swift

    public func handleUrl(url: String)

    Parameters

    url

    The url of the stream that should be played.

  • 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()
  • 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 taped - parameter tap: UITapGestureRecognizer

    Declaration

    Swift

    public func tap(sender: UITapGestureRecognizer?)

    Parameters

    tap

    UITapGestureRecognizer

  • Callback on player view is doubleTaped - 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()