Skip to content

What does browserSupportedMimes mean? #46

Description

@skjnldsv

browserSupportedMimes in lib/models/audios.ts and lib/models/videos.ts reads as a claim about what a browser can decode. It is not one, and some of what it lists no engine claims:

mime canPlayType Chromium Firefox listed in
audio/vorbis no no audios
audio/aacp no maybe audios
video/mpeg no no videos
video/x-flv no no videos
video/quicktime no maybe videos

Nothing is broken by that. The list decides which files the viewer offers to open; the handler then either plays the bytes or reports an error, and a media element reads the bytes rather than the declared type. #45 measured that end of it: one WAV served as audio/wav, audio/vnd.wave, audio/x-wav and application/octet-stream played in both engines, though canPlayType answers "no" for audio/vnd.wave.

So the question is what the list is meant to be, and the name should then say it:

  • If it is what we route to the handler, then handledMimes or similar is the honest name, and entries like audio/vorbis are harmless but pointless: vorbis is a codec inside audio/ogg, not a container type a file carries.
  • If it is what we expect to play, then it needs trimming, and that is a behaviour change for anyone whose files carry those types today.

Worth deciding once for both handlers rather than per pull request.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AI assistedstatus: triageNeeds triage - check if valid and reproducibletype: discussion💬 This issue is about gathering opinions and/or resolving dilemmas

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions