Post

Replies

Boosts

Views

Activity

Reply to Crash observed in iOS 18.4 beta on opening camera from WebView.
I've run into this exact issue on iOS 18.4 (and just tested - still happens in 18.5 beta). The crash occurs when you try to get both camera + mic permissions at the same time using: navigator.mediaDevices.getUserMedia( default) // ← This crashes! Fix: You need to request them separately: /** * Request camera permission only * @returns {Promise<MediaStream>} Video stream */ async function requestCameraPermission() { try { const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: false }); console.log('Successfully obtained camera permission'); return stream; } catch (error) { console.error('Camera permission request failed:', error); throw error; } } /** * Request microphone permission only * @returns {Promise<MediaStream>} Audio stream */ async function requestMicrophonePermission() { try { const stream = await navigator.mediaDevices.getUserMedia({ audio: true, video: false }); console.log('Successfully obtained microphone permission'); return stream; } catch (error) { console.error('Microphone permission request failed:', error); throw error; } } // Usage example: // requestCameraPermission() // .then(videoStream => { // const videoElement = document.createElement('video'); // videoElement.srcObject = videoStream; // document.body.appendChild(videoElement); // videoElement.play(); // return requestMicrophonePermission(); // }) // .then(audioStream => { // console.log('Microphone ready'); // }) // .catch(error => { // console.error('Permission request failed:', error); // });
Topic: Safari & Web SubTopic: General Tags:
Apr ’25