VideoMetaDataMap
What's the videoMetaDataMap?​
The videoMetaDataMap
is a DivaBOAdapter
parameter you can value with an async function that
- Receives the VideoMetadata within the
videoMetadata
object - Can modify the
videoMetadata
properties value - Returns the
videoMetadata
object
Value 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.
Sample code​
class ExampleVideoMetadataProvider {
}
extension ExampleVideoMetadataProvider: VideoMetadataProvider {
func requestVideoMetadata(
videoId: String,
currentVideoMetadata: VideoMetadata?,
playbackState: PlaybackState
) async throws -> VideoMetadata {
SWVideoMetadataCleanModel.make(
videoId: videoId,
title: "title",
image: "https://www.image.jpg",
eventId: "eventId",
programDateTime: "2018-07-15T13:40:15.681Z",
trimIn: 0,
trimOut: 100,
assetState: .vod,
ad: "https://divademo.deltatre.net/DIVAProduct/www/Data/Vast/skippable2.xml",
sources: [
SWVideoSourceCleanModel.make(
uri: "https://vod-ffwddevamsmediaservice.streaming.mediaservices.windows.net/6e8b64ef-feb3-4ea9-9c63-32ef7b45e1dd/6e8b64ef-feb3-4ea9-9c63-32ef7b45.ism/manifest(format=m3u8-aapl,filter=hls)",
format: "HLS"
)
],
audioTracks: [SWAudioTrackCleanModel(_id: "English1" , selector: "English", label: "English")],
defaultAudioTrackId: "English1",
dvrType: .full
)
}
}