What does browserSupportedMimes mean?

クローズ
#46 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
説明が足りない
活発さ
活発
技術スタック
typescript
領域
frontend, web-dev

調査の方向性

lib/models/audios.ts と lib/models/videos.ts の browserSupportedMimes を読み、その後 issue #45 で測定された挙動を確認してください。リストがルーティングされたファイルタイプを表すのか、想定される再生タイプを表すのかを明確にし、両方の handler で使用する名前とポリシーを 1 つに決めてください。実装前にスコープと挙動の変更の有無が決まっていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

AI assisted status: triage type: discussion

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.

主要言語
TypeScript
スター
2
フォーク
1
平均マージ
19時間 47分
マージ済み PR(30日)
78

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nextcloud-libraries/nextcloud-viewer のほかの issue

nextcloud-libraries/nextcloud-viewer の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。