Dataprovider

“dataProvider” attribute of player configuration object can be JSON formatted Media Object (described below), or array of Media Objects as a media playlist.

1. Media Object:

Field nameTypeDescription
idstringMedia asset id.
titlestringMedia asset title.
durationnumberMedia duration in milliseconds.
sourcearrayArray of media source metadata objects (for more details see Media Source Object).
splashImagesarrayArray of splash image metadata objects (for more details see Media Splash Image Object).
mediaLandingPagestringUrl pointing to media landing page.
subtitlesSetsarraySubtitles configuration for subtitles not embedded in video stream (loading one language from single external file).

title

Data type: string

Description: Identifier for media. Used for media identification for Bradmax analytics. It is string, so it is customizable. This parameter is required for proper work of Bradmax analytics statistics for content / media.

"dataProvider": {
    "id": "701"
}

title

Data type: string

Description: Title of media asset.

"dataProvider": {
    "title": "Tears of steel"
}

duration

Data type: string

Description: Media asset duration time in milliseconds.

"dataProvider": {
    "duration": 734.097415
}

source

Data type: array

Description: Array of media source objects, for more details see Media Source Object

"dataProvider": {
    "source": [
        {
            "contentType": "movie",
            "url": "http://bradmax.com/static/video/tos/440272.mpd",
            "bitrate": 191999,
            "width": 1280,
            "height": 534
        }
    ]
}

splashImages

Data type: array

Description: Array of media splash image objects, for more details see Media Splash Image Object

"splashImages": [
    {
        "url": "http://bradmax.com/static/images/startsplash.jpg",
        "width": 955,
        "height": 397
    }
]

mediaLandingPage

Data type: string

Description: Url pointing to media landing page.

"dataProvider": {
    "mediaLandingPage": "http://bradmax.com"
}

2. Media Source Object:

Field nameTypeDescription
contentTypestringContent type name.
urlstringURL pointing to media asset.
bitratenumberBitrate of media asset.
widthnumberWidth of media asset in pixels.
heightnumberHeight of media asset in pixels.

source contentType

Data type: string

Description: Content type name. Possible values 'movie’, 'trailer’, 'live’.

"dataProvider": {
    "source": [
        {
            "contentType": "movie",
        }
    ]
}

source url

Data type: string

Description: URL pointing to media asset.

"dataProvider": {
    "source": [
        {
            "url": "http://bradmax.com/static/video/tos/440272.mpd",
        }
    ]
}

source bitrate

Data type: number

Description: Bitrate of media asset.

"dataProvider": {
    "source": [
        {
            "bitrate": 191999
        }
    ]
}

source width

Data type: number

Description: Width of media asset in pixels.

"dataProvider": {
    "source": [
        {
            "width": 955
        }
    ]
}

source height

Data type: number

Description: Height of media asset in pixels

"dataProvider": {
    "source": [
        {
            "height": 397
        }
    ]
}

3. Media Splash Image Object:

Field nameTypeDescription
urlstringURL pointing to image asset.
widthnumberWidth of image asset in pixels.
heightnumberHeight of image asset in pixels.

splashImage url

Data type: string

Description: URL pointing to image asset

"dataProvider": {
    "splashImages": [
        {
            "url": "http://bradmax.com/static/images/startsplash.jpg"
        }
    ]
}

splashImage width

Data type: number

Description: Width of image asset in pixels.

"dataProvider": {
    "splashImages": [
        {
            "width": 955
        }
    ]
}

splashImage height

Data type: number

Description: Height of image asset in pixels

"dataProvider": {
    "splashImages": [
        {
            "height": 397
        }
    ]
}

4. Media Subtitles Configuration

Data type: array

Description: Subtitles configuration. Subtitles can be embedded in all video streams types: HLS, MPEG/DASH, Microsoft Smooth Streaming. In that case only link to video stream is needed. Bradmax player during video stream load checks automatically if there are any embedded subtitles and show list of them under subtitles pop-up. This process is automatic and doesn’t need any changes in player configuration.

In case, when there is a already encoded video stream without subtitles and subtitles are available in external files (all subtitles are available via URL to file *.srt, *.vtt, *.webvtt) “subtitlesSet” configuration option is needed.

"dataProvider": {
    "subtitlesSets": [
        { "languageCode": "en", "url": "https://cdn.example.com/subtitels_for_en.srt" },
        { "languageCode": "fr", "url": "https://cdn.example.com/subtitels_for_fr.srt" },
        { "languageCode": "de", "url": "https://cdn.example.com/subtitels_for_de.srt" },
        { "languageCode": "cz", "url": "https://cdn.example.com/subtitels_for_cz.srt" }
    ]
}
subtitlesSet entry field nameTypeDescription
languageCodestringIt is ISO 3166-1 language code. It can be defined as alpha-2 or alpha-3 (2 or 3 letter language code).
urlstringURL address for raw subtiles file (not compressed by zip or similar compression method).
Supported subtitles file formatsFile extensions
SRT*.srt
VTT*.vtt *.webvtt

Note: If you want automatically select some language for subtitles please check subtitles

5. Basic example

Basic example with minimal media configuration needed for proper bradmax statistics collection. "id", "title", “duration” fields are optional for video playback, but required for proper media details in bradmax statistics.

"dataProvider": {
    "id": "101",
    "title": "Big Buck Bunny",
    "duration": 596.0,
    "source": [{
        "url": "https://bradmax.com/static/video/tos/big_buck_bunny.m3u8",
    }]
}

6. Playlist example

Data provider configuration for defining playlist. For playlist replace configuration object for “dataProvider” by list of objects with configuration. More info: Playlist example

"dataProvider": [
    {
        "id": "101",
        "title": "Big Buck Bunny",
        "duration": 596.0,
        "source": [{
            "url": "https://bradmax.com/static/video/tos/big_buck_bunny.m3u8",
        }]
    },
    {
        "id": "102",
        "title": "Tears of steel",
        "duration": 734.097415,
        "source": [{
            "url": "https://bradmax.com/static/video/tears_of_steel.mp4",
        }],
        "splashImages": [{
            url: "http://bradmax.com/static/images/startsplash.jpg",
        }]
    }
]