Skip to content

Commit aa6fa12

Browse files
[doc] described mediaCapabilitiesInfo value
1 parent c232111 commit aa6fa12

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ const MyComponent = ({ videoSources }) => {
200200
};
201201
```
202202
203+
`mediaCapabilitiesInfo` value contains the three Boolean properties `supported`, `smooth`, and `powerefficient`, which describe whether decoding the media described would be supported, smooth, and powerefficient.
204+
203205
This utility accepts a [MediaDecodingConfiguration](https://developer.mozilla.org/en-US/docs/Web/API/MediaDecodingConfiguration) object argument and an optional `initialMediaCapabilitiesInfo` object argument, which can be used to provide a `mediaCapabilitiesInfo` state value when the user's browser does not support the relevant [Media Capabilities API](https://developer.mozilla.org/en-US/docs/Web/API/Media_Capabilities_API) or no media configuration was given.
204206

205207
### Adaptive Code-loading & Code-splitting

media-capabilities/media-capabilities.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe('useMediaCapabilitiesDecodingInfo', () => {
8686
expect(result.current.mediaCapabilitiesInfo).toEqual({hasMediaDecodingConfig: false, supported: true});
8787
});
8888

89-
test('should return MediaCapabilitiesInfo for given media decoding configuration', () => {
89+
test('should return MediaCapabilitiesInfo for given media configuration', () => {
9090
Object.defineProperty(window.navigator, 'mediaCapabilities', {
9191
value: {
9292
decodingInfo: mediaDecodingConfig => mediaCapabilitiesMapper[mediaDecodingConfig.audio.contentType]

0 commit comments

Comments
 (0)