BBNativePlayerAPI
class BBNativePlayerAPI: @preconcurrency EventListenerInterface
Public Player API
Functions
autoPlayNextCancel
func autoPlayNextCancel ()
Cancel AutoPlayNext countdown
closeModalPlayer
func closeModalPlayer() -> Void
Closes an existing modal player
collapse
func collapse ()
Collapse
enterFullScreen
func enterFullScreen ()
Fullscreen (only works on normal content)
exitFullScreen
func exitFullScreen ()
NormalScreen
expand
func expand ()
Expand
getModalPlayerView
func getModalPlayerView() -> UIView?
Return the UIView used by the ModalPlayer, you can use this to add your own UI elements on top
loadWithClipId
func loadWithClipId (clipId: String, initiator: String? = "external", autoPlay: Bool? = true, seekTo: NSNumber? = nil, context: [String: Any]? = nil) -> Void
Load With Clip Id
- Parameter clipId
- Parameter initiator (optional, default: "external")
- Parameter autoPlay (optional, default: true)
- Parameter seekTo (optional, default: null)
- Parameter context (optional): Context dictionary with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId
loadWithClipJson
func loadWithClipJson (clipJson: String, initiator: String? = "external", autoPlay: Bool? = true, seekTo: NSNumber? = nil, context: [String: Any]? = nil) -> Void
Load With Clip JSON
- Parameter clipJson
- Parameter initiator (optional, default: "external")
- Parameter autoPlay (optional, default: true)
- Parameter seekTo (optional, default: null)
- Parameter context (optional): Context dictionary with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId
loadWithClipListId
func loadWithClipListId (clipListId: String, initiator: String? = "external", autoPlay: Bool? = true, seekTo: NSNumber? = nil, context: [String: Any]? = nil, listOffset: Int? = nil) -> Void
Load With Clip List Id
- Parameter clipListId
- Parameter initiator (optional, default: "external")
- Parameter autoPlay (optional, default: true)
- Parameter seekTo (optional, default: null)
- Parameter context (optional): Context dictionary with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId
loadWithClipListJson
func loadWithClipListJson (clipListJson: String, initiator: String? = "external", autoPlay: Bool? = true, seekTo: NSNumber? = nil, context: [String: Any]? = nil) -> Void
Load With Clip List JSON
- Parameter clipListJson
- Parameter initiator (optional, default: "external")
- Parameter autoPlay (optional, default: true)
- Parameter seekTo (optional, default: null)
- Parameter context (optional): Context dictionary with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId
loadWithProjectId
func loadWithProjectId (projectId: String, initiator: String? = "external", autoPlay: Bool? = true, seekTo: NSNumber? = nil, context: [String: Any]? = nil) -> Void
Load With Project Id
- Parameter projectId
- Parameter initiator (optional, default: "external")
- Parameter autoPlay (optional, default: true)
- Parameter seekTo (optional, default: null)
- Parameter context (optional): Context dictionary with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId
loadWithProjectJson
func loadWithProjectJson(projectJson: String, initiator: String? = "external", autoPlay: Bool? = true, seekTo: NSNumber? = nil, context: [String: Any]? = nil) -> Void
Load With Project JSON
- Parameter projectJson
- Parameter initiator (optional, default: "external")
- Parameter autoPlay (optional, default: true)
- Parameter seekTo (optional, default: null)
- Parameter context (optional): Context dictionary with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId
pause
func pause()
Pause playback
play
func play()
Start / Resume playback
seek
func seek(offsetInSeconds: NSNumber)
Seek to time offset
seekRelative
func seekRelative(offsetInSeconds: NSNumber)
Seek relative to the current position (e.g. +10.0 or -10.0 seconds)
setMuted
func setMuted (muted: Bool, userAction: Bool = false)
Set Muted state
- Parameter muted
- Parameter userAction (optional, default: false)
setVolume
func setVolume (volume: Double, userAction: Bool = false)
Set Volume [0.0 - 1.0]
- Parameter volume
- Parameter userAction (optional, default: false)
unload
func unload () -> Void
Unload
updatePlayoutWithJson
func updatePlayoutWithJson(playoutJson: String) -> Void
Update Playout With JSON
@param playoutJson
Properties
adMediaHeight
var adMediaHeight: Int?
Ad media height in pixels (read-only)
adMediaWidth
var adMediaWidth: Int?
Ad media width in pixels (read-only)
clipData
var clipData: MediaClip?
Clip data (read-only)
createChromeCastButton
var createChromeCastButton: GCKUICastButton?
Create Cast button for google chromecast (read-only)
Deprecated: use BBNativePlayer.createChromeCastButton(frame:) instead.
duration
var duration: Double?
Media duration in seconds (read-only)
fullscreen
var fullscreen: Bool?
Get fullscreen state
getChromeCastMiniControlsView
var getChromeCastMiniControlsView: UIView?
Gets the MiniMediaControlsContainerView view for google chromecast, place this where you want in the app to give the user access to the controls (optional) Visibility will be handled by player logic when needed
Deprecated: use BBNativePlayer.getChromeCastMiniControlsView() instead.
inView
var inView: Bool?
InView override
isCasting
var isCasting: Bool?
InView override
mode
var mode: String?
Mode (read-only) @see https://support.bluebillywig.com/player-api/events-modes-and-phases/#2-0-modes
muted
var muted: Bool?
Muted state
phase
var phase: Phase?
Phase (read-only) @see https://support.bluebillywig.com/player-api/events-modes-and-phases/#3-0-phases
playoutData
var playoutData: Playout?
Playout data (read-only)
projectData
var projectData: Project?
Project data (read-only)
relatedItems
var relatedItems: [ContentItemInterface]?
Related items
state
var state: State?
State (read-only) @see https://support.bluebillywig.com/player-api/events-modes-and-phases/#4-0-states
volume
var volume: Float?
Volume [0.0 - 1.0]