Add per-source camera and microphone permission #530

Open
Arkkis wants to merge 1 commit from Arkkis/media-access-checkbox into master
Arkkis commented 2026-07-28 06:24:22 -05:00 (Migrated from github.com)

Description

Added checkbox to browser source to allow browser to access camera and microphone.
image

Motivation and Context

This allows usage of cameras and microphones via browser source easier than using launch flag: --enable-media-stream

How Has This Been Tested?

This has been tested by building OBS Studio locally, and used webcam embedded web page for testing.

OS: CachyOS x86_64
Kernel: Linux 7.1.4-1-cachyos
Camera: Elgato Facecam MK2
OBS Studio Source version: 32.2.1

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
<!--- Please fill out the following template, which will help other contributors review your Pull Request. --> <!--- Make sure you’ve read the contribution guidelines here: https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.md --> ### Description <!--- Describe your changes in detail. --> Added checkbox to browser source to allow browser to access camera and microphone. <img width="1682" height="1348" alt="image" src="https://github.com/user-attachments/assets/14895840-86c0-40ce-8990-48d44d84d4e2" /> <!--- If this change includes UI elements, please include screenshots. --> ### Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open GitHub Issue, or implements feature request --> <!--- from the Ideas page, please link to the issue here. --> This allows usage of cameras and microphones via browser source easier than using launch flag: --enable-media-stream ### How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment (hardware, OS version, etc.),--> <!--- and the tests you ran, including how it may affect other areas of code. --> This has been tested by building OBS Studio locally, and used webcam embedded web page for testing. OS: CachyOS x86_64 Kernel: Linux 7.1.4-1-cachyos Camera: Elgato Facecam MK2 OBS Studio Source version: 32.2.1 ### Types of changes <!--- What types of changes does your PR introduce? Uncomment all that apply --> <!--- - Bug fix (non-breaking change which fixes an issue) --> - New feature (non-breaking change which adds functionality) <!--- - Tweak (non-breaking change to improve existing functionality) --> <!--- - Performance enhancement (non-breaking change which improves efficiency) --> <!--- - Code cleanup (non-breaking change which makes code smaller or more readable) --> <!--- - Breaking change (fix or feature that would cause existing functionality to change) --> <!--- - Documentation (a change to documentation pages) --> ### Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I have read the [**contributing** document](https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.md). - [x] My code has been run through [clang-format](https://github.com/obsproject/obs-studio/blob/master/.clang-format). - [x] My code follows the project's [**style guidelines**](https://github.com/obsproject/obs-studio/blob/master/CODESTYLE.md) - [x] My code is not on the master branch. - [x] My code has been tested. - [x] All commit messages are properly formatted and commits squashed where appropriate. - [x] I have included updates to all appropriate documentation.
WizardCM commented 2026-07-28 09:47:21 -05:00 (Migrated from github.com)

@Warchamp7 Would you prefer this as-is, or a dropdown similar to Page permissions, allowing the user to choose from something like

None
Audio only (microphone, etc)
Video only (display, webcam, window, etc)
Audio and video

github.com/WizardCM/obs-browser@83b9929495

Or some other implementation.

@Warchamp7 Would you prefer this as-is, or a dropdown similar to Page permissions, allowing the user to choose from something like > None > Audio only (microphone, etc) > Video only (display, webcam, window, etc) > Audio and video https://github.com/WizardCM/obs-browser/commit/83b99294956854d5b59471fbae4174fbffad6f56 Or some other implementation.
Warchamp7 commented 2026-07-28 13:45:50 -05:00 (Migrated from github.com)

I'd like to know more about the use cases this is for first.

I'd like to know more about the use cases this is for first.
Arkkis commented 2026-07-28 13:50:03 -05:00 (Migrated from github.com)

I'd like to know more about the use cases this is for first.

My own usecase is to use webcam in web app running inside browser source.
It's not possible currently without global flag so using this kind of web app is harder for user to take into use.

> I'd like to know more about the use cases this is for first. My own usecase is to use webcam in web app running inside browser source. It's not possible currently without global flag so using this kind of web app is harder for user to take into use.
Warchamp7 commented 2026-07-28 13:55:44 -05:00 (Migrated from github.com)

I'd like to know more about the use cases this is for first.

My own usecase is to use webcam in web app running inside browser source. It's not possible currently without global flag so using this kind of web app is harder for user to take into use.

What sort of web app? Basically why is this needed in OBS versus simply capturing an actual proper browser instead?

> > I'd like to know more about the use cases this is for first. > > My own usecase is to use webcam in web app running inside browser source. It's not possible currently without global flag so using this kind of web app is harder for user to take into use. What sort of web app? Basically why is this needed in OBS versus simply capturing an actual proper browser instead?
Arkkis commented 2026-07-28 14:01:23 -05:00 (Migrated from github.com)

I'd like to know more about the use cases this is for first.

My own usecase is to use webcam in web app running inside browser source. It's not possible currently without global flag so using this kind of web app is harder for user to take into use.

What sort of web app? Basically why is this needed in OBS versus simply capturing an actual proper browser instead?

Since it's webcam overlay, I think browser source is better fit than capturing browser when you can just drop link into OBS and it works right away. This is simply the easiest experience for user.

> > > I'd like to know more about the use cases this is for first. > > > > > > My own usecase is to use webcam in web app running inside browser source. It's not possible currently without global flag so using this kind of web app is harder for user to take into use. > > What sort of web app? Basically why is this needed in OBS versus simply capturing an actual proper browser instead? Since it's webcam overlay, I think browser source is better fit than capturing browser when you can just drop link into OBS and it works right away. This is simply the easiest experience for user.
Warchamp7 commented 2026-07-28 14:29:49 -05:00 (Migrated from github.com)

I'd like to know more about the use cases this is for first.

My own usecase is to use webcam in web app running inside browser source. It's not possible currently without global flag so using this kind of web app is harder for user to take into use.

What sort of web app? Basically why is this needed in OBS versus simply capturing an actual proper browser instead?

Since it's webcam overlay, I think browser source is better fit than capturing browser when you can just drop link into OBS and it works right away. This is simply the easiest experience for user.

What sort of webcam overlay? Can you please provide an actual example?

> > > > I'd like to know more about the use cases this is for first. > > > > > > > > > My own usecase is to use webcam in web app running inside browser source. It's not possible currently without global flag so using this kind of web app is harder for user to take into use. > > > > > > What sort of web app? Basically why is this needed in OBS versus simply capturing an actual proper browser instead? > > Since it's webcam overlay, I think browser source is better fit than capturing browser when you can just drop link into OBS and it works right away. This is simply the easiest experience for user. What sort of webcam overlay? Can you please provide an actual example?
Arkkis commented 2026-07-28 14:32:09 -05:00 (Migrated from github.com)

I'd like to know more about the use cases this is for first.

My own usecase is to use webcam in web app running inside browser source. It's not possible currently without global flag so using this kind of web app is harder for user to take into use.

What sort of web app? Basically why is this needed in OBS versus simply capturing an actual proper browser instead?

Since it's webcam overlay, I think browser source is better fit than capturing browser when you can just drop link into OBS and it works right away. This is simply the easiest experience for user.

What sort of webcam overlay? Can you please provide an actual example?

There you go (WIP): https://efekti.arkkis.com/studio

> > > > > I'd like to know more about the use cases this is for first. > > > > > > > > > > > > My own usecase is to use webcam in web app running inside browser source. It's not possible currently without global flag so using this kind of web app is harder for user to take into use. > > > > > > > > > What sort of web app? Basically why is this needed in OBS versus simply capturing an actual proper browser instead? > > > > > > Since it's webcam overlay, I think browser source is better fit than capturing browser when you can just drop link into OBS and it works right away. This is simply the easiest experience for user. > > What sort of webcam overlay? Can you please provide an actual example? There you go (WIP): https://efekti.arkkis.com/studio
Warchamp7 commented 2026-07-28 15:17:37 -05:00 (Migrated from github.com)

There you go (WIP): https://efekti.arkkis.com/studio

I'm still not seeing a reasonable justification for why this needs to be implemented as a browser source instead of a separate page or even standalone app.

> There you go (WIP): https://efekti.arkkis.com/studio I'm still not seeing a reasonable justification for why this _needs_ to be implemented as a browser source instead of a separate page or even standalone app.
This pull request has changes conflicting with the target branch.
  • browser-client.hpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'Arkkis/media-access-checkbox:Arkkis/media-access-checkbox'
git switch 'Arkkis/media-access-checkbox'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'master'
git merge --no-ff 'Arkkis/media-access-checkbox'
git switch 'Arkkis/media-access-checkbox'
git rebase 'master'
git switch 'master'
git merge --ff-only 'Arkkis/media-access-checkbox'
git switch 'Arkkis/media-access-checkbox'
git rebase 'master'
git switch 'master'
git merge --no-ff 'Arkkis/media-access-checkbox'
git switch 'master'
git merge --squash 'Arkkis/media-access-checkbox'
git switch 'master'
git merge --ff-only 'Arkkis/media-access-checkbox'
git switch 'master'
git merge 'Arkkis/media-access-checkbox'
git push origin 'master'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-obsproject/obs-browser!530
No description provided.