chromium/third_party/blink/web_tests/fast/mediarecorder/MediaRecorder-isTypeSupported-avc1.html

<!DOCTYPE html>
<script src=../../resources/testharness.js></script>
<script src=../../resources/testharnessreport.js></script>
<script>

// Check some AVC1/H264 MIME types that should be recordable. Supported MIME
// types return true. Same for Audio.
// https://w3c.github.io/mediacapture-record/MediaRecorder.html#methods

test(function() {
  assert_true(MediaRecorder.isTypeSupported("video/webm;codecs=h264"));
  assert_true(MediaRecorder.isTypeSupported("video/webm;codecs=H264"));
  assert_true(MediaRecorder.isTypeSupported("video/webm;codecs=avc1"));
  // "video/webm" supports audio codec specification, see
  // http://www.webmproject.org/docs/container/
  assert_true(MediaRecorder.isTypeSupported("video/webm;codecs=h264,opus"));
  assert_true(MediaRecorder.isTypeSupported("video/webm;codecs=h264,vp9,opus"));
  // https://matroska.org/technical/specs/notes.html#MIME
  assert_true(MediaRecorder.isTypeSupported("video/x-matroska;codecs=avc1"));
  assert_true(MediaRecorder.isTypeSupported("video/x-matroska;codecs=avc1.42000c"));
  assert_true(MediaRecorder.isTypeSupported("video/x-matroska;codecs=avc1.4d000c"));
  assert_true(MediaRecorder.isTypeSupported("video/x-matroska;codecs=avc1.64000c"));
  assert_true(MediaRecorder.isTypeSupported("video/x-matroska;codecs=avc1.640029"));
  assert_true(MediaRecorder.isTypeSupported("video/x-matroska;codecs=avc1.640034"));
}, 'check MediaRecorder.isTypeSupported() with valid video MIME types');

</script>