You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If the permission has not been granted yet, but also not been blocked, then request permission.
37
+
letpermissionStatus=awaitcheck(cameraPermission);
38
+
if(permissionStatus=="denied")
39
+
{
40
+
permissionStatus=awaitrequest(cameraPermission);
41
+
}
42
+
43
+
// If the permission has still not been granted, then throw an appropriate exception, otherwise continue with the actual XR session initialization.
44
+
switch(permissionStatus){
45
+
case"unavailable":
46
+
thrownewDOMException(DOMError.NotSupportedError);
47
+
case"denied":
48
+
case"blocked":
49
+
thrownewDOMException(DOMError.SecurityError);
50
+
case"granted":
51
+
return;
52
+
}
53
+
}
54
+
24
55
// Override the WebXRSessionManager.initializeSessionAsync to insert a camera permissions request. It would be cleaner to do this directly in the native XR implementation, but there are a couple problems with that:
25
56
// 1. React Native does not provide a way to hook into the permissions request result (at least on Android).
26
57
// 2. If it is done on the native side, then we need one implementation per platform.
// If the permission has not been granted yet, but also not been blocked, then request permission.
48
-
letpermissionStatus=awaitcheck(cameraPermission);
49
-
if(permissionStatus=="denied")
50
-
{
51
-
permissionStatus=awaitrequest(cameraPermission);
52
-
}
74
+
// Override the VideoTexture.CreateFromWebCamAsync to insert a camera permissions request. It would be cleaner to do this directly in the NativeCamera implementation, but there are a couple problems with that:
75
+
// 1. React Native does not provide a way to hook into the permissions request result (at least on Android).
76
+
// 2. If it is done on the native side, then we need one implementation per platform.
0 commit comments