BMPUserInterfaceAPI

Objective-C

@protocol BMPUserInterfaceAPI <NSObject>

Swift

protocol UserInterfaceAPI : NSObjectProtocol

API methods related to the user interface.

  • Returns YES if the player is currently in fullscreen mode.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isFullscreen) BOOL fullscreen;

    Swift

    var isFullscreen: Bool { get }

    Return Value

    YES if the player is currently in fullscreen mode.

  • Returns YES if the players playback controls are currently shown, NO if they are hidden.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=areControlsShown) BOOL controlsShown;

    Swift

    var areControlsShown: Bool { get }

    Return Value

    YES if the players playback controls are currently shown, NO if they are hidden.

  • Returns if Picture-In-Picture is available. Picture in Picture-In-Picture in the following use-cases:

    • on iPhone using iOS 14.2 and above. (We disabled PiP on iOS 14.0 and 14.1 due to an underlying iOS bug)
    • on iPads using iOS 9 and above.
    • if not explicitly disabled through BMPPlaybackConfiguration#isPictureInPictureEnabled (default is disabled)

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isPictureInPictureAvailable) BOOL pictureInPictureAvailable;

    Swift

    var isPictureInPictureAvailable: Bool { get }

    Return Value

    YES if the Picture-In-Picture is available.

  • Returns YES if player is currently in Picture-in-Picture (PiP) mode.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isPictureInPicture) BOOL pictureInPicture;

    Swift

    var isPictureInPicture: Bool { get }

    Return Value

    YES if Picture-In-Picture is active, NO otherwise.

  • A value defining how the video is displayed within the parent container’s bounds. Possible values are defined in ScalingMode.

    When a value was set before the Player was added to the view, it will have precedence over the value configured in StyleConfig.scalingMode

    Declaration

    Objective-C

    @property (nonatomic) BMPScalingMode scalingMode;

    Swift

    var scalingMode: BMPScalingMode { get set }
  • The player enters Picture-In-Picture mode. Has no effects if already in picture in picture.

    @note:

    • Starting Picture-In-Picture during casting is not supported and will result in a no-op.
    • This has no effect when using system UI.

    Declaration

    Objective-C

    - (void)enterPictureInPicture;

    Swift

    func enterPictureInPicture()
  • The player exits Picture-In-Picture mode. Has no effect if not in Picture-In-Picture mode.

    @note: This has no effect when using system UI.

    Declaration

    Objective-C

    - (void)exitPictureInPicture;

    Swift

    func exitPictureInPicture()
  • The player enters fullscreen mode. Has no effect if in fullscreen.

    Declaration

    Objective-C

    - (void)enterFullscreen;

    Swift

    func enterFullscreen()
  • The player exits fullscreen mode. Has no effect if not in fullscreen.

    Declaration

    Objective-C

    - (void)exitFullscreen;

    Swift

    func exitFullscreen()
  • Sets a poster image which will be displayed before playback starts.

    Declaration

    Objective-C

    - (void)setPosterImage:(nonnull NSURL *)url keepPersistent:(BOOL)keepPersistent;

    Swift

    func setPosterImage(url: URL, keepPersistent: Bool)

    Parameters

    url

    The URL to the poster image

    keepPersistent

    Flag to set the poster image persistent so it is also displayed during playback.

  • Set the subtitle styles which should be applied to WebVTT subtitles and other legible text. Setting subtitle styles using this method completely replaces all previously set subtitle styles.

    Setting subtitle styles is only supported when the userInterfaceType in the StyleConfiguration is set to BMPUserInterfaceTypeSystem or BMPUserInterfaceTypeSubtitle.

    Declaration

    Objective-C

    - (void)setSubtitleStyles:(nullable NSArray<AVTextStyleRule *> *)subtitleStyles;

    Swift

    func setSubtitleStyles(_ subtitleStyles: [Any]?)

    Parameters

    subtitleStyles

    The subtitle styles which should be applied.