Skip to main content

VideoMetaDataMap

What's the videoMetaDataMap?​

The videoMetaDataMap is a DivaExtraParams parameter you can set using a lambda expression that

  • Receives the VideoMetadata within the videoMetadata object
  • Can modify the videoMetadata properties value
  • Returns the videoMetadata object

Use the videoMetaDataMap parameter when

  • You need to get some videoMetadata properties' value to implement front-end business logic.
  • You need to alter runtime some videoMetadata properties' value.
  • The videoMetadata object can contain medialist properties as an array of items.
  • VideoMetadata JSON structure
     {
    ...,
    "mediaLists": [
    {
    ... first media list
    },
    {
    ... second media list
    },
    ...
    ],
    ...
    }

Sample code​

val divaExtraParams = DivaExtraParams(videoMetaDataMap = {videoMetadata ->
//read/write videoMetadata properties and implement your front-end business logic <---
videoMetadata.copy(mediaLists = mediaList )
})

Add as many elements to the array as there are media lists items. The following fields define a media list with array of items (i.e., an array item):

MediaList(
listId = "",
defaultImageFormat = MediaListImageFormat.tile,
rowTitle = DICTIONARY_EOP_RELATED_TITLE_KEY,
defaultItemType = MediaListItemType.video,
items = relatedItems.map {
val videoSetting = DivaBoVideoType.from(it)
MediaListItem(
itemType = MediaListItemType.related,
itemId = "{videoId}",
title = "{item Title}",
imageUrl = it.images?.get(ImageType.TILE),
caption = "",
ccBadge = false,
adBadge = false,
explicitBadge = false,
entitledToView = false,
channelLogo = "https://channellogo.png",
channelDescription = "channelDescription",
lockicon = "https://lockicon.png",
locktext = "locktext"
)
},
)