Vinyl
    Preparing search index...

    Function filterDashByLanguage

    • Filters Dash adaptation sets by preferred language using BCP 47 relatedness matching.

      Strategy:

      1. Collect all unique languages from adaptation sets that have a lang attribute.
      2. Find the best matching language using relatedness scoring.
      3. If a match is found, keep only adaptation sets whose language matches at the same relatedness level (or better), plus any adaptation sets without a language tag.
      4. If no match is found (all languages are unrelated), return the manifest unchanged.
      5. Never filters to an unplayable state — if filtering would remove all adaptation sets in any period, the manifest is returned unchanged.

      Parameters

      Returns DashManifest