Ask for camera access only once per web session?

infinascape

New Member
Hello, I am new to Flashphoner, just using it a few days and getting used to it. I have a webrtc setup (a website application) where you can click a button to test your camera without publishing a stream, and then another button to actually publish. When I click the button to test the camera, it asks for camera access permission as expected and then activates the camera. Then when I click the button to publish, it asks for permission again, even though I just granted it and the camera is already activated. Is there a way for the camera permission to be saved for the entire session? I'm testing in Firefox.
 

Max

Administrator
Staff member
Good day.
You probably testing the Media Devices example. The example lists all your connected devices available to a browser, to show how to select a camera and switch between them
1615256073320.png

Also the example shows how to test if camera is available to browser and how to release the camera when "Test" button is pressed.
If you're pressing "Test" button right after opening Media Devices page, the page asks for permissions to the default camera and microphone. Then, if you're pressing "Connect" then "Publish" buttons, the page asks for permissions to the first camera in list. If those are the different cameras, the permissions will be asked twice, one request per camera.
Please note that you probably do not need to use camera test in production before publishing.
 
Top