nextcloud-libraries / nextcloud-libraries/nextcloud-viewer

What does browserSupportedMimes mean?

Open
#46 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

AI assisted status: triage type: discussion
Dominant language
TypeScript
Stars
1
Forks
0
Avg merge
6h 19m
Merged PRs (30d)
43

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read browserSupportedMimes in lib/models/audios.ts and lib/models/videos.ts, then review the behavior measured in issue #45. Clarify whether the lists describe routed file types or expected playback types, and agree on one name and policy for both handlers. Done means the scope and any behavior change are decided before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.