diff --git a/index.bs b/index.bs index e8197e2..1014bbf 100644 --- a/index.bs +++ b/index.bs @@ -1209,7 +1209,46 @@ spec: secure-contexts; urlPrefix: https://www.w3.org/TR/secure-contexts/

Examples

-

Query recording capabilities with {{encodingInfo()}}

+

Query playback capabilities with {{decodingInfo()}}

+

+ The following example shows how to use {{decodingInfo()}} to query + media playback capabilities when using Media Source Extensions + [[media-source]]. +

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

Query recording capabilities with {{encodingInfo()}}

The following example can also be found in e.g.