Skip to main content

BBNativePlayerAPI

class BBNativePlayerAPI(playerView: BBNativePlayerView, eventBus: EventBus?) :
EventListenerInterface

BBNativePlayerAPI is the convenience API, accessible via BBNativePlayerView::player. It simply wraps BBNativePlayerView::callApiMethod & BBNativePlayerView::getApiProperty

Parameters

NameDescription
playerView

Properties

phase

val phase: Phase?

Phase (read-only)

state

val state: State?

State (read-only)

mode

val mode: String?

Mode (read-only)

isCasting

val isCasting: Boolean?

isCasting (read-only)

playoutData

val playoutData: Playout?

Playout data (read-only)

projectData

val projectData: Project?

Project data (read-only)

clipData

val clipData: MediaClip?

Clip data (read-only)

relatedItems

var relatedItems: List<ContentItemInterface>?

Related items

volume

var volume: Double?

Volume [0.0 - 1.0]

muted

var muted: Boolean?

Muted state

controls

var controls: Boolean?

Controls shown

inView

var inView: Boolean?

InView override

duration

val duration: Double?

Media duration in seconds (read-only)

adMediaWidth

val adMediaWidth: Int?

Ad media width in pixels (read-only)

adMediaHeight

val adMediaHeight: Int?

Ad media height in pixels (read-only)

Functions

__destruct

fun __destruct () : Unit

Destruct, freeing all memory allocated internally

unload

fun unload () : Unit

Unload

loadWithClipId

fun loadWithClipId (clipId: String, initiator: String? = "external", autoPlay: Boolean? = true, seekTo: Number? = null, context: Map<String, Any?>? = null) : Unit

Load With Clip Id

Parameters:

NameDescription
clipId
initiator(optional, default: "external")
autoPlay(optional, default: true)
seekTo(optional, default: null)
context(optional): Context map with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId

loadWithClipListId

fun loadWithClipListId (clipListId: String, initiator: String? = "external", autoPlay: Boolean? = true, seekTo: Number? = null, context: Map<String, Any?>? = null) : Unit

Load With Clip List Id

Parameters:

NameDescription
clipListId
initiator(optional, default: "external")
autoPlay(optional, default: true)
seekTo(optional, default: null)
context(optional): Context map with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId

loadWithProjectId

fun loadWithProjectId (projectId: String, initiator: String? = "external", autoPlay: Boolean? = true, seekTo: Number? = null, context: Map<String, Any?>? = null) : Unit

Load With Project Id

Parameters:

NameDescription
projectId
initiator(optional, default: "external")
autoPlay(optional, default: true)
seekTo(optional, default: null)
context(optional): Context map with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId

loadWithClipJson

fun loadWithClipJson (clipJson: String, initiator: String? = "external", autoPlay: Boolean? = true, seekTo: Number? = null, context: Map<String, Any?>? = null) : Unit

Load With Clip JSON

Parameters:

NameDescription
clipJson
initiator(optional, default: "external")
autoPlay(optional, default: true)
seekTo(optional, default: null)
context(optional): Context map with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId

loadWithClipListJson

fun loadWithClipListJson (clipListJson: String, initiator: String? = "external", autoPlay: Boolean? = true, seekTo: Number? = null, context: Map<String, Any?>? = null) : Unit

Load With Clip List JSON

Parameters:

NameDescription
clipListJson
initiator(optional, default: "external")
autoPlay(optional, default: true)
seekTo(optional, default: null)
context(optional): Context map with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId

loadWithProjectJson

fun loadWithProjectJson (projectJson: String, initiator: String? = "external", autoPlay: Boolean? = true, seekTo: Number? = null, context: Map<String, Any?>? = null) : Unit

Load With Project JSON

Parameters:

NameDescription
projectJson
initiator(optional, default: "external")
autoPlay(optional, default: true)
seekTo(optional, default: null)
context(optional): Context map with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId

loadWithClip

fun loadWithClip (clip: MediaClip, initiator: String? = "external", autoPlay: Boolean? = true, seekTo: Number? = null, context: Map<String, Any?>? = null) : Unit

Load With Clip

Parameters:

NameDescription
clip
initiator(optional, default: "external")
autoPlay(optional, default: true)
seekTo(optional, default: null)
context(optional): Context map with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId

loadWithClipList

fun loadWithClipList (clipList: MediaClipList, initiator: String? = "external", autoPlay: Boolean? = true, seekTo: Number? = null, context: Map<String, Any?>? = null) : Unit

Load With Clip List

Parameters:

NameDescription
clipList
initiator(optional, default: "external")
autoPlay(optional, default: true)
seekTo(optional, default: null)
context(optional): Context map with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId

loadWithProject

fun loadWithProject (project: Project, initiator: String? = "external", autoPlay: Boolean? = true, seekTo: Number? = null, context: Map<String, Any?>? = null) : Unit

Load With Project

Parameters:

NameDescription
project
initiator(optional, default: "external")
autoPlay(optional, default: true)
seekTo(optional, default: null)
context(optional): Context map with keys like contextCollectionType, contextCollectionId, contextEntityType, contextEntityId

updatePlayoutWithJson

fun updatePlayoutWithJson (playoutJson: String) : Unit

Update Playout With JSON

Parameters:

NameDescription
playoutJson

play

fun play () : Unit

Start / Resume playback

pause

fun pause () : Unit

Pause playback

seek

fun seek (offsetInSeconds: Number, relativeToCurrentTime: Boolean = false) : Unit

Seek to time offset

autoPlayNextCancel

fun autoPlayNextCancel () : Unit

Cancel AutoPlayNext countdown

collapse

fun collapse () : Unit

Collapse

expand

fun expand () : Unit

Expand

enterFullScreen

fun enterFullScreen () : Unit

Enter fullscreen

exitFullScreen

fun exitFullScreen () : Unit

Leave fullscreen

setVolume

fun setVolume(volume: Double, userAction: Boolean = false)

Set Volume

Parameters:

NameDescription
volume
userAction(optional, default: false)

setMuted

fun setMuted(muted: Boolean, userAction: Boolean = false)

Set Muted state

Parameters:

NameDescription
muted
userAction(optional, default: false)