Skip to content
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

Webcam input #125

Open
wednesdayayay opened this issue Mar 11, 2023 · 4 comments
Open

Webcam input #125

wednesdayayay opened this issue Mar 11, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@wednesdayayay
Copy link

wednesdayayay commented Mar 11, 2023

Is your feature request related to a problem? Please describe.

Websites that use your webcam don't seem to be able to pull the webcam feed at least on Ventura 13.2.1. Screen sharing also doesn't seem to work.

Describe the solution you'd like

I'd love to see the ability to directly set your webcam as the background and select which webcam you are using. If that can't happen The ability to use websites which pull your webcam feed. Usually I am asked for permission to use the camera but that popup doesn't show up when using plash.

Describe alternatives you've considered

I went into safari preferences and changed it to allow on cameras and also went to system preferences and allowed camera without asking. I've tried 4 or 5 different webcam testing websites and http://vdo.ninja but none of them show the camera.

Additional context

I have a video synthesis setup that uses software and hardware.
I want to be able to choose one of the webcam feeds from the video system and set it as the background and then use a lightweight media viewer to layer things on top of the webcam.
https://www.instagram.com/p/CpnqaenjAK4/
here is an example of what I'm doing but without the webcam feed as background.

@wednesdayayay wednesdayayay added the enhancement New feature or request label Mar 11, 2023
@dotzenith
Copy link

Coming here with the same request, I think it would be a rather nice addition to the app.

@willrogers007
Copy link

Diving deeper into the issue:

When I go into the console, it appears that window.navigator.mediaDevices is undefined - hence the lack of being able to pull from a webcam.

+1; I want this too!

I was about to make a page where I could have my camera video feed showing in the background, somewhat transparent, in a corner, similar to a part of The Mother of All Demos

@willrogers007
Copy link

willrogers007 commented Aug 22, 2023

Got it to work by editing the project on XCode

This is a rudimentary fix that simply connects the technical components necessary to make this happen. Practically speaking, this is the first XCode project I've ever edited, so Sindre: I'm sure you know a better spot to put the following code snippet. That said, here's what I did following the article Developer: Requesting Authorization for Media Capture on macOS.

At the beginning of AppState › init()

switch AVCaptureDevice.authorizationStatus(for: .video) {
    case .authorized: // The user has previously granted access to the camera.
        // disabled because I have no idea what I'm doing (+ added a return)
        // self.setupCaptureSession()
        return
    
    case .notDetermined: // The user has not yet been asked for camera access.
        AVCaptureDevice.requestAccess(for: .video) { granted in
            if granted {
                // disabled because I have no idea what I'm doing:
                // self.setupCaptureSession()
            }
        }
    
    case .denied: // The user has previously denied access.
        return


    case .restricted: // The user can't grant access due to restrictions.
        return
}

CleanShot 2023-08-22 at 14 41 57@2x

CleanShot 2023-08-22 at 14 40 54@2x

Some considerations for Sindre

Users might not be expecting to be prompted unnecessarily for camera/microphone access, so it might be good to have this as something the user can opt into in the settings menu. I (tentatively) believe that it prompts for hardware access upon initial run of the Plash app, and additionally it made another UI permission request when my web page reached for navigator.mediaDevices.getUserMedia({ video: true }).

@johncoles
Copy link

I will take a look at a custom version using Xcode but it would be nice to have this as an option in the app Settings. I have a USB capture card connected to a Mac Mini I use as a status monitor in my office and the capture card has HDMI video going in to it (such as TV, CCTV cameras etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants