Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...
    • Select a codec that the platform can actually encode at the requested resolution and bitrate.

      Algorithm:

      1. Map the user's preference to a mediabunny codec.
      2. If the container is WebM and the mapped codec isn't WebM-compatible, pre-downgrade to vp9 (the most universally available WebM codec).
      3. Test the mapped codec with canEncodeVideo. Use it if supported.
      4. Otherwise walk a fallback list: HEVC's chain prefers AVC first; everything else prefers VP9. WebM-mode filters the list to its compatible subset.
      5. Return the first supported codec, or null if nothing works.

      Parameters

      Returns Promise<CodecSelectionResult>