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

Fix blank consent recordings #388

Closed becky-gilbert closed 3 weeks ago

becky-gilbert commented 1 month ago

Fixes #387

Summary

This PR fixes the problem with blank consent videos with the following changes:

video-consent

  1. Disable the 'start recording' button when the video consent page first loads, so that it only becomes enabled when the recorder is ready.
  2. Require the 'recorderReady' property to be true before enabling the 'start recording' button.

video-assent

  1. If trial recording is used, check if the recorder is ready when the trial loads. If so, show a (translated) 'please wait' message and wait until the recorder is actually ready to record before starting the trial.
  2. Whenever the recorder is ready, either show the first consent page (if recordLastPage is true), or start recording and then trigger the first consent page after recording has started (if recordWholeProcedure is true).

Testing steps

I've done this testing locally on Firefox and Chrome. I will repeat these tests on staging/production once the code is reviewed.

video-consent

video-assent

record whole procedure

record last page

no recording

session recording

For all tests

Screenshots

Here's what video-consent looks like before the recorder is ready. (It's a little hard to tell, but the 'start consent recording' button is disabled.)

The browser permissions request is just there because I intentionally revoked the permissions to stop the recorder from being ready while I got a screenshot - if the permissions were already granted then they will not be requested again!

Screenshot 2024-05-30 at 12 10 01 PM

Here's what video-assent looks like when trial recording is used and the recorder is not ready.

The browser permissions request is just there because I intentionally revoked the permissions to stop the recorder from being ready while I got a screenshot - if the permissions were already granted then they will not be requested again!

Screenshot 2024-05-30 at 12 01 43 PM

becky-gilbert commented 1 month ago

@ianchandlercampbell oh sorry, I totally agree and I'm not actually requiring the user to re-approve permissions! I only disabled my own permissions for testing purposes, and so that the page stayed in the 'not ready to record' state for long enough for me to take a screenshot. The permissions will work exactly the same as before.

becky-gilbert commented 1 month ago

Hmm, I edited the PR description to include a lot more detail and screenshots, but for some reason my updates are gone :( I'll update it again ASAP to reflect what I've actually done.

ianchandlercampbell commented 1 month ago

Oh sorry @becky-gilbert I clearly read too fast! I see that's part of testing