Reputation: 219
Does it exist a way to authorize the Web Cam by default?
Actually, I've found the following piece of code:
yield return Application.RequestUserAuthorization(UserAuthorization.WebCam | UserAuthorization.Microphone);
if (Application.HasUserAuthorization(UserAuthorization.WebCam | UserAuthorization.Microphone)) {
} else {}
But this asks at the beginning of the program the authorization to the user. What I'd want is to automatically allow the WebCam functionality without giving a choice to the user to activate it or not.
I don't know if there exists something to enable/disable in the settings of Unity or something else...
Thank you for your answers.
Upvotes: 0
Views: 2567
Reputation: 125255
What I'd want is to automatically allow the WebCam functionality without giving a choice to the user to activate it or not.
No, you can't do that. That was put in place for security and privacy reasons. You can't use somebody's webcam or microphone without their permission in WebGL or Unity Web Player. If you look closely, you will realize that Flash asks for permission before accessing camera and microphone too. The user must consent to that.
I assume you have a laptop with a camera. Now, ask yourself, what could possibly go wrong without WebCam or Mic Authorization?
Upvotes: 3