decodingInfo() method to detect the media capabilities of the device before starting the playback. In such cases, applications can install a polyfill to get the Vega implementation of the decodingInfo() method and let the player take decisions accordingly. For more information on how to install polyfill, see the Install and set up W3C Media Capabilities section.
W3C Media Capabilities prerequisites
The W3C API implements Media Capabilities as part of Vega SDK. Apps must add this API to their package.json as dependency to get the required imports.Install and set up W3C Media Capabilities
- Set up a media player project.
- Install the polyfill as shown in the How to use W3C Media Capabilities section.
How to use W3C Media Capabilities
Apps that use ShakaPlayer
Shaka Player provides a polyfill as part of the release. For more information about the Shaka Player release for Vega, see Play adaptive content (HLS/DASH) with Shaka Player. This polyfill provides thedecodingInfo() method through navigator. Shaka Player internally uses this decodingInfo() method when it provides the implementation. To apply the new implementation without any additional code changes, update the Shaka Player dist folder.
Apps that use a JavaScript player that use decodingInfo() internally
Apps that use other players that need an implementation of decodingInfo() must manually install the polyfill.
decodingInfo() method. For more information, see the FAQs section.
Apps that use a JavaScript player that doesn’t depend on decodingInfo()
Players such as Theo and Bitmovin use canPlayType or isTypeSupported instead of decodingInfo(). Apps can either continue to use the same methods if they cater to their requirements or call into MediaCapabilities API outside the player and use the information to start the playback.
FAQs
How to check the Dolby support?
How to check the Dolby support?
decodingInfo() and isTypeSupported() methods consider the connected TV’s or AVR’s capabilities as well and return the results accordingly. The following code example shows the minimum configuration you can send to use the decodingInfo() method to check the Dolby support.What is the minimum config to check HDR support?
What is the minimum config to check HDR support?
How to enable decodingInfo() on Dash.js?
How to enable decodingInfo() on Dash.js?
decodingInfo() to Dash.js Player, apps must install the polyfill. The 4.0.0 release of Dash.js Player introduces support for MediaCapabilities API.Note: To use the decodingInfo() method instead of the isTypeSupported() method, set useMediaCapabilitiesApi value to true.How to enable on HLS.js player?
How to enable on HLS.js player?
decodingInfo() to HLS.js player, apps must install the polyfill. The 1.5.0-alpha release of HLS.js player introduces support for the MediaCapabilities API.Make sure to enable useMediaCapabilities in HlsConfig.Note: HLS.js player uses the decodingInfo() method in the specific scenarios mentioned in the mediacapabilities-helper.ts source file in the HLS.js repo on GitHub.
