BBNativePlayer
class BBNativePlayer
A Utility class to create players
Functions
createChromeCastButton
static func createChromeCastButton(frame: CGRect) -> GCKUICastButton?
Create a ChromeCast button
Returns: GCKUICastButton
createJsonEmbedUrl
static func createJsonEmbedUrl(baseUrl: String, appIndicator: String, appId: String, contentIndicator: String? = nil, contentId: String? = nil) -> String
Create a json embed URL
- Parameter baseUrl the base URL, e.g. "https://demo.bbvms.com"
- Parameter appIndicator the application indicator, e.g. "p" for player
- Parameter appId the application config id, e.g. the playout code, or "_"
- Parameter contentIndicator the content indicator (optional), e.g. "c" for clip, "l" for list, "p" for project, "q" for query
- Parameter contentId the content id (optional), e.g. "7654321"
- Returns the json embed URL
createModalPlayerView
static func createModalPlayerView(uiViewContoller: UIViewController, jsonUrl: String, options: [String : Any]? ) -> BBNativePlayerView
Creates a BBNativePlayerView and presents it as a full screen modal
Parameters:
| Name | Description |
|---|---|
uiViewContoller | UIViewController - is used to present the modal player |
jsonUrl | The EMBED url the player will use to setup |
options | A dictionary with options to send to the player st creation. - Options: - "adsystem_ppid": String used to fill the ppid for google IMA - "adsystem_buid": String used for adsystem macro replacement - "adsystem_rdid": String used for adsystem macro replacement - "adsystem_idtype": String used for adsystem macro replacement - "adsystem_is_lat": Bool used for adsystem macro replacement - "noStats": Bool disables statistics logging when true, overrides playout setting - "commercials": Bool allow commercials, overrides playout setting - "allowCollapseExpand": Bool honour collapse / expand requests - "waitForCmp": Bool wait for Consent Management, then setup - "handleConsentManagement": Bool handle Consent Management -- needs waitForCmp - "tagForUnderAgeOfConsent": Bool - "consent_string": String default consent string - "consent_gdprApplies": Int default GDPR applies - "consent_cmpVersion": Int default CMP version - "autoPlay": Bool auto play, overrides playout setting - "noChromeCast": Bool disables chromeCast functionality when true, overrides playout setting castButton - "showChromeCastMiniControlsInPlayer": Bool (default false) Shows the ChromeCast MiniControls in the player when needed - "adTagUrlParam_[key]": Any Custom parameters to add to ad tag URLs. Multiple parameters supported with different keys (e.g., "adTagUrlParam_userId": "12345") - "companionAdSizes": [[Int]] additional outstream companion ad sizes to match, as [width, height] pairs (e.g. [[970, 250], [336, 280]]); added on top of the built-in sizes - "showBackArrow": Bool shows a back arrow in the top-left corner of the modal player that closes the modal |
Returns: BBNativePlayerView
createModalPlayerView
static func createModalPlayerView(uiViewContoller: UIViewController, jsonUrl: String ) -> BBNativePlayerView
Creates a BBNativePlayerView and presents it as a full screen modal
Parameters:
| Name | Description |
|---|---|
uiViewContoller | UIViewController - is used to present the modal player |
jsonUrl | The EMBED url the player will use to setup |
Returns: BBNativePlayerView
createPlayerView
static func createPlayerView( uiViewController: UIViewController, frame: CGRect, jsonUrl: String, options: [String : Any]? ) -> BBNativePlayerView
Creates a BBNativePlayerView
Parameters:
| Name | Description |
|---|---|
frame | The size of the player |
jsonUrl | The EMBED url the player will use to setup |
options | A dictionary with options to send to the player st creation. - Options: - "adsystem_ppid": String used to fill the ppid for google IMA - "adsystem_buid": String used for adsystem macro replacement - "adsystem_rdid": String used for adsystem macro replacement - "adsystem_idtype": String used for adsystem macro replacement - "adsystem_is_lat": Bool used for adsystem macro replacement - "noStats": Bool disables statistics logging when true, overrides playout setting - "commercials": Bool allow commercials, overrides playout setting - "allowCollapseExpand": Bool honour collapse / expand requests - "waitForCmp": Bool wait for Consent Management, then setup - "handleConsentManagement": Bool handle Consent Management -- needs waitForCmp - "tagForUnderAgeOfConsent": Bool - "consent_string": String default consent string - "consent_gdprApplies": Int default GDPR applies - "consent_cmpVersion": Int default CMP version - "autoPlay": Bool auto play, overrides playout setting - "noChromeCast": Bool disables chromeCast functionality when true, overrides playout setting castButton - "showChromeCastMiniControlsInPlayer": Bool (default false) Shows the ChromeCast MiniControls in the player when needed - "forceFullscreenLandscape": Bool rotate the video to landscape when the video goes fullscreen - "adTagUrlParam_[key]": Any Custom parameters to add to ad tag URLs. Multiple parameters supported with different keys (e.g., "adTagUrlParam_userId": "12345") - "companionAdSizes": [[Int]] additional outstream companion ad sizes to match, as [width, height] pairs (e.g. [[970, 250], [336, 280]]); added on top of the built-in sizes |
Returns: BBNativePlayerView
createPlayerView
static func createPlayerView( uiViewController: UIViewController, frame: CGRect, jsonUrl: String ) -> BBNativePlayerView
Creates a BBNativePlayerView
Parameters:
| Name | Description |
|---|---|
frame | The size of the player |
jsonUrl | The EMBED url the player will use to setup |
Returns: BBNativePlayerView
getChromeCastMiniControlsView
static func getChromeCastMiniControlsView() -> UIView?
Get the singleton ChromeCast mini controls
Returns: UIView