initialize-camera: `mime_type` is ignored since 8.2.2
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, typescript
- Domain
- audio-video-rtc, backend
Research direction
Read MediaAPI.initializeCameraRecorder() and the initialize-camera plugin code that passes mime_type as mimeType; the issue identifies both and shows the option selection logic. Check the camera recorder tests and add coverage for a caller-supplied MIME type and the existing fallback. Done when the supplied type reaches MediaRecorder and fallback selection still works.
Written by the indexing model from the issue text.
Description
The mime_type parameter of initialize-camera no longer has any effect. The plugin passes it to jsPsych.pluginAPI.initializeCameraRecorder() as mimeType, but MediaAPI.initializeCameraRecorder() spreads the options first and then sets mimeType from getCompatibleMimeType(), so the recorder always gets the first supported type from its built-in list (or video/webm if none is supported):
let mimeType = this.getCompatibleMimeType() || "video/webm";
const recorderOptions: MediaRecorderOptions = {
...opts,
mimeType
}
This came in with #3495 (first released in jspsych 8.2.2), "add default mimeType if none is specified", so the built-in list was meant only as a fallback.
For example, with mime_type: 'video/mp4; codecs="avc1.424028, mp4a.40.2"', jsPsych still passes video/webm;codecs=vp9,opus to MediaRecorder whenever the browser supports that type, since it comes first in the list.
A possible fix is to use the given type when there is one:
const mimeType = opts?.mimeType ?? this.getCompatibleMimeType() ?? "video/webm";
I'm happy to open a PR with a test.
Related: the built-in types all list two codecs, which makes the base64 parsing bug in #3445 affect most recordings; the open PR #3753 fixes that.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 745
- Avg merge
- 5h 50m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jspsych/jsPsych
-
DataColumn median/min/max/variance/sd treat null as 0 while mean() ignores itPossibly taken @Ester0Awad claimed this 12 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
record-video extension and html-video-response misparse the base64 string when include_audio is true in init_camera.Possibly taken A pull request linked to this issue is open or already merged. Openarea: extensions area: plugins bug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
area: core enhancement status: needs decision
Difficulty 5/5 Over a week Newbie friendliness 18/100
jspsych/jsPsych#3731 · 1 comment ·
Maintainers usually reply within 1 day
-
Data keys that start with a digit (e.g. "2back") are recorded as undefinedPossibly taken @sean0407 claimed this 53 days ago. Openarea: core bug help wanted
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
area: core enhancement status: needs decision
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Maintainers usually reply within 1 day
Similar issues
-
Media browser returns "Not found" for repositories using the SHA-256 object formatPossibly taken @adamchodera claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Follow-ups from #312Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
janhesters/remixcn#318 ·
Maintainers usually reply within 1 day
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
danielmiessler/LifeOS#3150 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Make the "%" unit spacing the same in the web and in A10Possibly taken @kragent66-glitch claimed this today. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 comment ·