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. More information on how install polyfill, see the Install and setup W3C Media Capabilities section.
W3C Media Capabilities prerequisites
The feature is implemented in the W3C API provided as part of Vega SDK. Apps must add this API to their package.json as dependency to get the required imports.Install and setup W3C Media Capabilities
- Setup 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
For apps that use Shaka Player, there is a polyfill that is provided as part of the Shaka Player 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 which uses decodingInfo() internally
Apps that use other players which 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 which doesn’t depend on decodingInfo()
Players such as Theo and Bitmovin use canPlayType or isTypeSupported instead of decodingInfo(). Applications 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. The support for MediaCapabilities API is introduced in 4.0.0 release of Dash.js Player.Note: To use the decodingInfo() method instead of the isTypeSupported() method, make sure that the useMediaCapabilitiesApi is set to true.How to enable on HLS.js player?
How to enable on HLS.js player?
decodingInfo() to HLS.js player. The support for MediaCapabilities was introduced in 1.5.0-alpha release.Make sure that useMediaCapabilities is enabled in the HlsConfig.Note: The decodingInfo() method is used by HLS.js player only in specific scenarios mentioned in the mediacapabilities-helper.ts source file in HLS.js repo on GitHub.
