Screen recording using getUserMedia doesn't resume on machine unlock

776 views
Skip to first unread message

Girivasan Kalyanasundaram

unread,
Sep 27, 2023, 10:38:52 AM9/27/23
to media-dev
Hi,

We record windows desktop screen using navigator.mediaDevices.getUserMedia api. When the machine is locked (Win + l) during active desktop screen recording, recording (MediaStream) stopped and doesn't resume after unlocking the machine.
Is there a chromium flag/option to make recording (MediaStream) resume on unlocking the machine. Web Camera's MediaStream is getting stopped on machine lock and resumed on unlocking machine. And also I would like to understand why this is being handled in this manner for screen sharing/recording, compared to streaming web camera. Could you please let me know reasoning behind this ?

Please see https://chromium.googlesource.com/chrom ... ger.cc#963 and https://chromium.googlesource.com/chrom ... ger.cc#934

Dale Curtis

unread,
Sep 27, 2023, 12:39:32 PM9/27/23
to Girivasan Kalyanasundaram, media-dev
Yes you can use --disable-features=StopVideoCaptureOnScreenLock to prevent this behavior.

Users were surprised their camera remained active behind the lock screen -- which becomes a privacy issue. After a long enough time users would be surprised if the camera came back on when they returned to their machine. So we disable it after a timeout (chosen to be long enough that accidental locks have time to be undone).

- dale

--
You received this message because you are subscribed to the Google Groups "media-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to media-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/media-dev/782158d1-3cfb-42ba-b2de-a2e78a04198an%40chromium.org.

Girivasan Kalyanasundaram

unread,
Sep 28, 2023, 8:12:03 AM9/28/23
to media-dev, Dale Curtis, media-dev, Girivasan Kalyanasundaram
Thanks for the clarification. However while doing active screen sharing/recording and machine is locked, MediaStream of the screen stopped and doesn't get resumed on unlocking the machine. 
Is there a chromium flag/option to make screen MediaStream resume on unlocking the machine.

Girivasan Kalyanasundaram

unread,
Sep 28, 2023, 8:33:58 AM9/28/23
to media-dev, Girivasan Kalyanasundaram, Dale Curtis, media-dev
To follow up on above, this option seems to be working only for camera stream --disable-features=StopVideoCaptureOnScreenLock.
We want to continue record screen in our chromium app when the user locked the screen, or resume screen recording once the screen is unlocked by the user.
Could you please let me know if there a chromium flag/option to make screen MediaStream continue on locking the machine or an option to resume screen recording on unlocking machine. 

Dale Curtis

unread,
Sep 28, 2023, 12:20:19 PM9/28/23
to Girivasan Kalyanasundaram, media-dev
The only flag that exists for this feature is the command line one I provided.

- dale

Girivasan Kalyanasundaram

unread,
Sep 28, 2023, 1:24:58 PM9/28/23
to media-dev, Dale Curtis, media-dev, Girivasan Kalyanasundaram
Okay, we are particularly interested in screen sharing/recording. 
Do you/anyone aware why the behavior is inconsistent between the screen share and camera streaming/recording ? 
There's an explicit comment saying not to resume screen share in here. We would like to understand reasoning behind this.
Is there somewhere that the rationale for this is explained ? Appreciate your help on this.

Dale Curtis

unread,
Sep 28, 2023, 1:42:47 PM9/28/23
to Girivasan Kalyanasundaram, media-dev
I believe both have the same reason, it's unexpected to the user in ways that may have surprising consequences.

- dale

Girivasan Kalyanasundaram

unread,
Oct 3, 2023, 3:50:36 AM10/3/23
to media-dev, Dale Curtis, media-dev, Girivasan Kalyanasundaram
Thanks !

- Giri

Girivasan Kalyanasundaram

unread,
Oct 3, 2023, 12:03:23 PM10/3/23
to media-dev, Girivasan Kalyanasundaram, Dale Curtis, media-dev
Main reason could be that windows lock screen has eye button, when user clicks on it, password would be screen shared or recorded. This is a security concern. That's why I think there isn't an option to continue streaming screen for sharing/recording purposes in windows lock screen. However automatic resumption of screen stream after unlocking the machine with an chromium option would be better.
Reply all
Reply to author
Forward
0 new messages