Skip to main content

BBNativeShorts

class BBNativeShorts

BBNativeShorts offers static factory functions for creating the views that do the actual work

Functions

createShortsView

fun createShortsView(context: Context, jsonUrl: String?, options: Map<String, Any?>? = null) : BBNativeShortsView

Create a Shorts view

  • context: any host whose context chain leads to a FragmentActivity (AppCompatActivity also works — it's a FragmentActivity). The SDK walks the ContextWrapper chain, so a ContextThemeWrapper around an activity is fine. Required for the fullscreen and settings-sheet features.
  • jsonUrl: the json embed URL (nullable)
  • options: the options dictionary (optional), options recognized:
    • displayFormat: full | list | player
    • shelfStartSpacing: Int - spacing at the start of the shorts list
    • shelfEndSpacing: Int - spacing at the end of the shorts list

Parameters:

NameDescription
contextthe view context
jsonUrlthe json embed URL (nullable)
optionsthe options dictionary (optional)

Returns: the Shorts view

createJsonEmbedUrl

fun createJsonEmbedUrl(baseUrl: String, appIndicator: String, appId: String, contentIndicator: String? = null, contentId: String? = null) : String

Create a json embed URL

  • baseUrl: the base URL, e.g. "https://demo.bbvms.com"
  • appIndicator: the application indicator, e.g. "p" for player
  • appId: the application config id, e.g. the playout code
  • contentIndicator: the content indicator (optional), e.g. "c" for clip
  • contentId: the content id, e.g. "7654321"

Parameters:

NameDescription
baseUrlthe base URL, e.g. "https://demo.bbvms.com"
appIndicatorthe application indicator, e.g. "sh" for shorts experience
appIdthe application config id, e.g. the shorts experience id
contentIndicatorthe content indicator (optional), e.g. "l" for list
contentIdthe content id, e.g. "7654321"

Returns: the json embed URL