lookit / ember-lookit-frameplayer

Ember app with experiment frames and a frame player to run browser-based experiments
MIT License
5 stars 19 forks source link

Browser-compatibility problems with RecordRTC video playback #364

Closed becky-gilbert closed 4 months ago

becky-gilbert commented 4 months ago

Bug description

Videos recorded with RecordRTC cannot always be played across browsers. This is causing problems for (1) participants who need to play their own recording back before they can continue with the experiment (see #363), and (2) researchers who can only view the consent videos in the browser (vs the other trial/session recordings that are made available after consent is approved, which can be downloaded and opened in various other programs). Specifically, consent videos recorded in Chrome were showing a 'mime type not supported' error on the Consent Manager page.

Solution

This seems to be caused by specifying "video/webm" as the recording type in RecordRTC, without specifying the codecs. In Firefox (and probably other browsers?), the browser uses default codecs that are compatible with the webm container type. But in Chrome, specifying "video/webm" actually produces a Matroska file ("video/x-matroska;codecs=avc1"), which then cannot be played in the HTML5 video element. The solution to this is to specify the video/audio codecs. To do this, we also have to check the browser's container/codec support, and pass that into the recording config.