Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples for decodingInfo() #147

Closed
mounirlamouri opened this issue Jan 28, 2020 · 3 comments
Closed

Add examples for decodingInfo() #147

mounirlamouri opened this issue Jan 28, 2020 · 3 comments
Assignees

Comments

@mounirlamouri
Copy link
Member

Following up from a TPAC action, see https://www.w3.org/2019/09/18-mediawg-minutes.html#item09

We want to add examples for decodingInfo(). Today, there are only encodingInfo() examples and we got feedback that more examples would be welcomed.

@wilaw
Copy link

wilaw commented Mar 13, 2020

Here is a script example for decodingInfo() which matches that for encodingInfo()

<script>
const configuration = {
      type : 'media-source',
      video : {
        contentType : 'video/mp4;codecs=avc1.640028',
        width : 640,
        height : 360,
        bitrate : 2000,
        framerate : 29.97
    }
  };
  navigator.mediaCapabilities.decodingInfo(configuration)
      .then((result) => {
        console.log('Decoding of ' + configuration.video.contentType + ' is'
            + (result.supported ? '' : ' NOT') + ' supported,'
            + (result.smooth ? '' : ' NOT') + ' smooth and'
            + (result.powerEfficient ? '' : ' NOT') + ' power efficient');
      })
      .catch((err) => {
        console.error(err, ' caused decodingInfo to throw an error');
      });
</script>

@chrisn
Copy link
Member

chrisn commented Mar 13, 2020

I created PR #151 to add @wilaw's example. We should also consider adding examples including audio and encryption configurations.

@chrisn
Copy link
Member

chrisn commented Dec 13, 2023

I'll close this, as we have #197 for adding a MediaCapabilitiesKeySystemConfiguration example.

@chrisn chrisn closed this as completed Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants