| Test basic dictionary and enum types of Media Capabilities API |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'file' }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'media-source' }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'file', audio: { } }); |
| } rejected promise with TypeError: Member AudioConfiguration.contentType is required and must be an instance of DOMString. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'file', audio: { contentType: 'video/mp4; codecs="avc1"' } }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'file', video: { } }); |
| } rejected promise with TypeError: Member VideoConfiguration.bitrate is required and must be an instance of unsigned long long. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'file', video: { contentType: 'audio/mp3', width: 640, height: 480, bitrate: 1000, framerate: 24 } }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'file', video: { contentType: 'video/mp4; codecs="avc1"', height: 480, bitrate: 1000, framerate: 24 } }); |
| } rejected promise with TypeError: Member VideoConfiguration.width is required and must be an instance of unsigned long. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'file', video: { contentType: 'video/mp4; codecs="avc1,vp9"', width:640, height: 480, bitrate: 1000, framerate: 24 } }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'file', video: { contentType: 'video/mp4', width:640, height: 480, bitrate: 1000, framerate: 24 } }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'file', video: { contentType: 'video/mp4; codecs="avc1"', width: 640, height: 480, bitrate: 1000, framerate: 0 } }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'file', video: { contentType: 'video/mp4; codecs="avc1"', width: 640, height: 480, bitrate: 1000, framerate: "24/a" } }); |
| } rejected promise with TypeError: The provided value is non-finite. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'file', video: { contentType: 'video/mp4; codecs="avc1"', width: 640, height: 480, bitrate: 1000, framerate: "24/0" } }); |
| } rejected promise with TypeError: The provided value is non-finite. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'invalid', video: { contentType: 'video/mp4; codecs="avc1"', width: 640, height: 480, bitrate: 1000, framerate: 24 } }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.encodingInfo({ type: 'record' }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.encodingInfo({ type: 'record', audio: { } }); |
| } rejected promise with TypeError: Member AudioConfiguration.contentType is required and must be an instance of DOMString. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'record', audio: { } }); |
| } rejected promise with TypeError: Member AudioConfiguration.contentType is required and must be an instance of DOMString. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'record', audio: { contentType: 'video/mp4; codecs="avc1"' } }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'record', video: { } }); |
| } rejected promise with TypeError: Member VideoConfiguration.bitrate is required and must be an instance of unsigned long long. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'record', video: { contentType: 'audio/mp3', width: 640, height: 480, bitrate: 1000, framerate: 24 } }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'record', video: { contentType: 'video/mp4; codecs="avc1"', height: 480, bitrate: 1000, framerate: 24 } }); |
| } rejected promise with TypeError: Member VideoConfiguration.width is required and must be an instance of unsigned long. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'record', video: { contentType: 'video/mp4; codecs="avc1,vp9"', width:640, height: 480, bitrate: 1000, framerate: 24 } }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'record', video: { contentType: 'video/mp4', width:640, height: 480, bitrate: 1000, framerate: 24 } }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'record', video: { contentType: 'video/mp4; codecs="avc1"', width: 640, height: 480, bitrate: 1000, framerate: 0 } }); |
| } rejected promise with TypeError: Type error. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'record', video: { contentType: 'video/mp4; codecs="avc1"', width: 640, height: 480, bitrate: 1000, framerate: "24/a" } }); |
| } rejected promise with TypeError: The provided value is non-finite. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'record', video: { contentType: 'video/mp4; codecs="avc1"', width: 640, height: 480, bitrate: 1000, framerate: "24/-1" } }); |
| } rejected promise with TypeError: The provided value is non-finite. |
| PASS () => { |
| return navigator.mediaCapabilities.decodingInfo({ type: 'invalid', video: { contentType: 'video/mp4; codecs="avc1"', width: 640, height: 480, bitrate: 1000, framerate: 24 } }); |
| } rejected promise with TypeError: Type error. |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |