media-capabilities-encoding-info.https.html (1293B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/speculation-rules/prerender/resources/utils.js"></script> 5 <script src="/speculation-rules/prerender/resources/deferred-promise-utils.js"></script> 6 <script> 7 8 const params = new URLSearchParams(location.search); 9 10 // The main test page (restriction-media-capabilities-encoding-info.https.html) 11 // loads the initiator page then the initiator page will prerender itself with 12 // the `prerendering` parameter. 13 const isPrerendering = params.has('prerendering'); 14 15 // These configurations are copied from 16 // wpt/media-capabilities/encodingInfo.webrtc.html 17 const minimalVideoConfiguration = { 18 contentType: 'video/VP9; profile-level="0"', 19 width: 800, 20 height: 600, 21 bitrate: 3000, 22 framerate: 24, 23 }; 24 25 const minimalAudioConfiguration = { 26 contentType: 'audio/opus', 27 }; 28 29 const configuration = { 30 type: 'webrtc', 31 video: minimalVideoConfiguration, 32 audio: minimalAudioConfiguration, 33 }; 34 35 if (!isPrerendering) { 36 loadInitiatorPage(); 37 } else { 38 const prerenderEventCollector = new PrerenderEventCollector(); 39 prerenderEventCollector.start( 40 navigator.mediaCapabilities.encodingInfo(configuration), 'navigator.mediaCapabilities.encodingInfo'); 41 } 42 43 </script>