From 8d4babbd9e55a58554bb660c9bf90587fbd2316f Mon Sep 17 00:00:00 2001 From: Chris Needham Date: Fri, 13 Mar 2020 16:24:19 +0000 Subject: [PATCH 1/3] Add decodingInfo() example --- index.bs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/index.bs b/index.bs index e8197e2..2c38774 100644 --- a/index.bs +++ b/index.bs @@ -1208,6 +1208,45 @@ spec: secure-contexts; urlPrefix: https://www.w3.org/TR/secure-contexts/

Examples

+
+

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()}}

From 40d6706da3c10b84e6a9bd01a971813b82d5a6cb Mon Sep 17 00:00:00 2001 From: Chris Needham Date: Fri, 13 Mar 2020 18:58:15 +0000 Subject: [PATCH 2/3] Add parens in decodeInfo() --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 2c38774..7180124 100644 --- a/index.bs +++ b/index.bs @@ -1211,7 +1211,7 @@ spec: secure-contexts; urlPrefix: https://www.w3.org/TR/secure-contexts/

Query playback capabilities with {{decodingInfo()}}

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

From 817a353b4683a1d14bca40c7249ba7c571a62e36 Mon Sep 17 00:00:00 2001 From: Chris Needham Date: Fri, 13 Mar 2020 21:46:43 +0000 Subject: [PATCH 3/3] Fix example id --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 7180124..1014bbf 100644 --- a/index.bs +++ b/index.bs @@ -1248,7 +1248,7 @@ spec: secure-contexts; urlPrefix: https://www.w3.org/TR/secure-contexts/
-

Query recording capabilities with {{encodingInfo()}}

+

Query recording capabilities with {{encodingInfo()}}

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