-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent screen blanking/screensaver #777
Comments
I think whether or not this is desired behaviour would greatly depend on the use case. I'm not sure whether the library (components) is the right place for this. I guess adding a wakelock to github.com/livekit-examples/meet might make sense |
That's fine with me :) I'll try to hook into |
I've added export function JoinRoom(props: { token: string, url: string }) {
const screen = useStayAwake()
function onJoin(choices: LocalUserChoices) {
screen.preventSleeping()
}
function onLeave() {
screen.allowSleeping()
}
if (preJoinChoices === null) {
return <PreJoin onSubmit={onJoin} />
}
return <LiveKitRoom onDisconnected={onLeave}>
<VideoConference chatMessageFormatter={formatChatMessageLinks} />
</LiveKitRoom>
} AFAICT, this seems to work. (Here, I've omitted handling of Footnotes
|
I'll withdraw my previous comment: While the background media inserted by With Firefox 124 (scheduled for release mid-March) to enable the Screen Wake Lock API by default, would you accept a PR which adds that to the |
Have you confirmed that it's working in isolation? If we were to add screen lock wake, then the livekit/client-sdk-js repo would be the best place for it. However, I'm not sure if this is the right approach. It's unexpected that your screen blanks in the first place while video is being played back. |
I don't have hard evidence, just some observations when screen blanking does not occur on my machine:
I do however have quite an old installation of Debian 11/Gnome 3.38.5 which might play into this (upgrading is a problem of finding a bit of time to do so :)). |
Describe the problem
On my machine, the screen blanks (and actually locks) after 5min of inactivity (i.e. no mouse or keyboard input). For company policy reasons, I cannot disable that behaviour.
It is a bit of an annoyance, when my monitor goes into sleep mode in the middle of a sentence, as it takes a moment to recover from that...
Describe the proposed solution
Browsers usually prevent screensavers from activating, when they play media (and NoSleep.js promises to provide such a functionality).
I'm not sure why the video/audio tracks of LiveKit itself don't count towards this behaviour.
Speculation
I presume this is because the tracks don't actually originate from a user input event, such as a button click?
For example, the local video track already exists in the
<PreJoin/>
prefab, even before I click on the "Join" button. And remote tracks of course are added without user interaction at all.There's also the Screen Wake Lock API, but Firefox support is missing:
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: