TOP can play media content via media json.
Passing a mediaId to the playByMediaJson API (see example):
player.playByMediaJson({
mediaId: 'b481d427055fdce823fa30b39abf07a931a67e44'
});Note: an appId is required with the medium service. See AppId for more details.
Default configuration values will be used (see Configuration Options).
There are several optional configuration properties that can be set (see playByMediaJson API docs for more details).
Available Media Json configuration options:
cms configMedia Json configuration can be done for all plays via cms.
var playerConfig = {
config : {
cms : {
// Setting the default provider configuration for all 'playByMediaJson' calls.
// These config values will be used unless otherwise overriden by the play data
// passed into the 'playByMediaJson' api
providers : {
'top.cms.provider.mediaJson' : {
host : '//refmedium.ngtv.io/media',
mediaTypes : ['preview', 'unprotected'],
platform : 'phone'
}
}
}
}
};
player.init(playerConfig);In the override defaults on init example, the current and all subsequent media json play calls will use the configuration set in the cms.providers object.
In this case:
host is set to load media json data from //refmedium.ngtv.io/media instead of the default //medium.ngtv.io/mediamediaTypes is configured to retrieve data first for preview (if available) otherwise for unprotected (default is ['bulkaes', 'unprotected'])platform is configured to retrieve data for phones instead of the default desktopPlay configuration options will only apply to a particular play call. Subsequent media json plays will not use those options specified on previous calls. To specify media json configuration for all play calls, see CMS Configuration above.
Configuration specified on the play call will override any configuration options set on the cms configuration
player.playByMediaJson({
mediaId: 'b481d427055fdce823fa30b39abf07a931a67e44',
// Setting the provider configuration only for this play call
mediaTypes : ['preview', 'unprotected'],
platform : 'phone'
});In the override on play example, only the current media json play calls will use the configuration set in the data object.
In this case:
mediaTypes is configured to retrieve data first for preview (if available) otherwise for unprotected (default is ['bulkaes', 'unprotected'])platform is configured to retrieve data for phones instead of the default desktop