csswg-drafts icon indicating copy to clipboard operation
csswg-drafts copied to clipboard

[mediaqueries] `streaming` media feature for implementing streamer mode

Open nickserv opened this issue 1 year ago • 8 comments

I'm proposing streaming as a discrete media feature with active and none, used when streaming software is running or not running (respectively). This could be used to implement a streamer mode feature to Discord's, which automatically hides sensitive information when streaming software is running. This is necessary because software often exposes personal info that can be used for doxing or hacking.

nickserv avatar Sep 29 '24 06:09 nickserv

Example using streaming to toggle displaying the user's phone number on stream:

@media (streaming: active) {
  .phone {
    display: none;
  }
}

@media (streaming: none) {
  .phone {
    display: block;
  }
}
document.querySelector(".phone").style.display = window.matchMedia(
  "(streaming: active)",
).matches
  ? "none"
  : "block";

nickserv avatar Sep 29 '24 06:09 nickserv

I like the concept, but I don't like the name. It makes it sound like it has something to do with network streams. It also excludes a lot of other use cases, like a simple video recording or say a presentation.

Speaking of presentation; how about using that as the name?

@media (presentation: active) { }

@media (presenting: yes) { }

KennethHoff avatar Sep 30 '24 15:09 KennethHoff

Maybe it should be even more generic actually; say a prefers-* media query

KennethHoff avatar Sep 30 '24 17:09 KennethHoff

Maybe it should be even more generic actually; say a prefers-* media query

There could be something like prefers-privacy, but I feel you should be able to toggle this automatically:

@media (prefers-privacy: auto) { }

nickserv avatar Sep 30 '24 18:09 nickserv

I like the concept, but I don't like the name. It makes it sound like it has something to do with network streams. It also excludes a lot of other use cases, like a simple video recording or say a presentation.

Speaking of presentation; how about using that as the name?

I don't think streaming and presenting are the same use case though. For example if I'm presenting at an internal company meeting and our address shows up it's not a big deal, but I wouldn't want to leak my address if I were streaming at home.

I was trying to make the name consistent with scripting, but maybe streamer-mode would be more obvious, as it seems to the the de facto standard used by existing implements in native apps.

nickserv avatar Sep 30 '24 18:09 nickserv

This sounds like a reasonable idea, tho I also don't like the name. ^_^ Do you know how Discord detects when you're streaming? It's not something that the OS itself communicates, right?

tabatkins avatar Oct 02 '24 22:10 tabatkins

This sounds like a reasonable idea

Thanks! I'm implementing a proprietary version currently, but I feel like this would be way more useful as part of the web platform.

tho I also don't like the name. ^_^

What do you think about the names in my previous two comments (prefers-privacy and streamer-mode)?

Do you know how Discord detects when you're streaming? It's not something that the OS itself communicates, right?

Based on my testing, Discord seems to use system APIs to determine if streaming apps are running (but it doesn't care if they're actually streaming or recording). Discord only documents support for OBS and XSplit, however I noticed Streamlabs Desktop works, so it's likely either looking for apps based on OBS or using a custom allowlist that actually includes more than those two apps. As far as I'm aware, there is no system API, apps are probably just looking at open processes or windows.

nickserv avatar Oct 02 '24 23:10 nickserv

@tabatkins Hey, friendly reminder, could you please reply? I'd like to unblock this.

nickserv avatar Oct 18 '24 02:10 nickserv