It is possible to get the media capabilities and to decide which action to take accordingly.
This API will give you the following information:
It is optional to pass an object parameter to the API, which will contain the HEVC configuration to test. See below a list of the optional properties:
width
(number) - Optional width of the video. default is 1920
.height
(number) - Optional height of the video. default is 1080
.bitrate
(number) - Optional number of bits used to encode a second of video. default is 1200000
.framerate
(number) - Optional number of frames used in one second. default is 30
.The Media Capabilities API is returning the following object structure:
isHEVCSupported
(number) - Specifies the HEVC supported type by the browserisPowerEfficient
(number) - Specifies power efficiency supported typeisDRMSupported
(number) - Specifies the DRM supported type by the browsersupportedDRMs
(Array) - List of supported DRMs (optional values: widevine, playready, fairplay)Note - the optional numbers for the flags are:
// after calling KalturaPlayer.setup().....
kalturaPlayer.getMediaCapabilities({width: 1280, height: 720}).then(mediaCapabilities => {
// print the media capabilities result to the console
console.log('media capabilities result --> ', {mediaCapabilities});
// load drm media or clear media, based on the API response
kalturaPlayer.loadMedia({entryId: mediaCapabilities.isDRMSupported === 1 ? DRM_ENTRY_ID : CLEAR_ENTRY_ID});
});
Note: the API should be invoked after calling KalturaPlayer.setup() API
See below a list of online resources to help you choose the values you need: