6
This commit is contained in:
parent
d8eb881141
commit
399c66edfd
@ -24,7 +24,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
const sceneVideoFileInput = document.getElementById('scene-video-file-input');
|
||||
|
||||
// Camera specific elements
|
||||
const cameraPermissionPrompt = document.getElementById('camera-permission-prompt');
|
||||
const cameraPermissionGroup = document.getElementById('camera-permission-group');
|
||||
const grantCameraPermissionBtn = document.getElementById('grant-camera-permission-btn');
|
||||
const cameraDeviceSelection = document.getElementById('camera-device-selection');
|
||||
const sceneCameraDeviceInput = document.getElementById('scene-camera-device-input');
|
||||
@ -183,23 +183,41 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
// --- CAMERA & DEVICE MANAGEMENT ---
|
||||
function resetCameraUI() {
|
||||
cameraPermissionGranted = false;
|
||||
if (sceneCameraDeviceInput) {
|
||||
sceneCameraDeviceInput.innerHTML = ''; // Clear dropdown
|
||||
}
|
||||
if (cameraErrorMessage) {
|
||||
cameraErrorMessage.textContent = ''; // Clear any old errors
|
||||
}
|
||||
if (cameraDeviceSelection) {
|
||||
cameraDeviceSelection.style.display = 'none'; // Hide device selector
|
||||
cameraPermissionPrompt.style.display = 'block'; // Show permission button
|
||||
}
|
||||
if (cameraPermissionGroup) {
|
||||
cameraPermissionGroup.style.display = 'block'; // Show permission button
|
||||
}
|
||||
}
|
||||
|
||||
function showCameraUI() {
|
||||
if (cameraErrorMessage) {
|
||||
cameraErrorMessage.textContent = '';
|
||||
}
|
||||
if (cameraPermissionGranted) {
|
||||
cameraPermissionPrompt.style.display = 'none';
|
||||
if (cameraPermissionGroup) {
|
||||
cameraPermissionGroup.style.display = 'none';
|
||||
}
|
||||
if (cameraDeviceSelection) {
|
||||
cameraDeviceSelection.style.display = 'block';
|
||||
}
|
||||
} else {
|
||||
// This is the initial state, handled by resetCameraUI
|
||||
cameraPermissionPrompt.style.display = 'block';
|
||||
if (cameraPermissionGroup) {
|
||||
cameraPermissionGroup.style.display = 'block';
|
||||
}
|
||||
if (cameraDeviceSelection) {
|
||||
cameraDeviceSelection.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function requestCameraPermission() {
|
||||
if (!window.isSecureContext) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user