mimeForCodec function

Last updated: 2026-03-05T10:53:28.864Z

Metrics

LOC: 10 Complexity: 3 Params: 1

Signature

mimeForCodec(codec: "vp8" | "vp9"): : string

Source Code

  function mimeForCodec(codec: "vp8" | "vp9"): string {
    const candidate = `video/webm;codecs=${codec}`;
    if (
      typeof MediaRecorder !== "undefined" &&
      MediaRecorder.isTypeSupported(candidate)
    ) {
      return candidate;
    }
    return "video/webm";
  }

No outgoing dependencies.

Impact (Incoming)

graph LR mimeForCodec["mimeForCodec"] start["start"] startWithStreamId["startWithStreamId"] start -->|calls| mimeForCodec startWithStreamId -->|calls| mimeForCodec style mimeForCodec fill:#dbeafe,stroke:#2563eb,stroke-width:2px click mimeForCodec "3b29e1b45edc4afa.html" click start "f0ed2d1a28e21447.html" click startWithStreamId "04e27d4934028102.html"
SourceType
start calls
startWithStreamId calls