- Home /
Access to WebCam denied - UWP unity app,Access denied to WebCam in UWP project
I have a simple project that displays the webcam on a raw image that I am trying to build as a UWP app. It works fine in the Unity editor but when you compile it as UWP (with webcam and microphone capabilities, of course), it says 'access denied' when you play the content.
Steps to reproduce:
1. Create a new unity project
2. Add a raw image
3. Add this script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PlayMovieTextureOnUI : MonoBehaviour {
public RawImage rawimage;
// Use this for initialization
void Start () {
WebCamTexture webcamTexture = new WebCamTexture();
rawimage.texture = webcamTexture;
rawimage.material.mainTexture = webcamTexture;
webcamTexture.Play();
}
}
Finally, try to compile and run it as UWP. If you have development build checked, you will see the error right there, otherwise you can see it in the debug log.
The access denied error prints in debug log when following line is executed:
webcamTexture.Play();
I am using Unity 2017.3.0f3, Visual studio 2017 15.5.3 on a Windows 10 machine and trying to run it on the app on the same machine that I am using for development.
Any thoughts on how to resolve it will be much appreciated. Thank you.
Your answer
Follow this Question
Related Questions
Efficient way to Capture Webcam image stream? 0 Answers
How to access a Webcam Moniker 0 Answers
Distribute terrain in zones 3 Answers
WebCamTexture IOS crashing? 1 Answer
Problems with webcam 1 Answer