IOS 14 - Safari with no support to navigator.mediaDevices API

Michael

Member
Hello

In our company, we have many people broadcasting by their mobile devices using web browser.

We are receiving complaints about IOS, with "no support to broadcast".

We use this function to check if device have broadcast support before call Flashphoner WebSDK functions:
JavaScript:
function is_publish_supported()
{
    return navigator.mediaDevices &&
            navigator.mediaDevices.getUserMedia &&
            navigator.mediaDevices.enumerateDevices &&
            window.RTCPeerConnection &&
            window.RTCIceCandidate &&
            window.RTCSessionDescription;
};
To debug the issue, we added this code snippet:
Code:
console.log("Unsupported debug - navigator.mediaDevices: " + Boolean(navigator.mediaDevices));
console.log("Unsupported debug - navigator.getUserMedia: " + (Boolean(navigator.mediaDevices) && Boolean(navigator.mediaDevices.getUserMedia)));
console.log("Unsupported debug - navigator.enumerateDevices: " + (Boolean(navigator.mediaDevices) && Boolean(navigator.mediaDevices.enumerateDevices)));
console.log("Unsupported debug - navigator.RTCPeerConnection: " + Boolean(window.RTCPeerConnection));
console.log("Unsupported debug - navigator.RTCIceCandidate: " + Boolean(window.RTCIceCandidate));
console.log("Unsupported debug - navigator.RTCSessionDescription: " + Boolean(window.RTCSessionDescription));
We are receiving this logs:
Code:
User Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1
19/01/2021 08:49:37 - Unsupported debug - navigator.mediaDevices: false
19/01/2021 08:49:37 - Unsupported debug - navigator.getUserMedia: false
19/01/2021 08:49:37 - Unsupported debug - navigator.enumerateDevices: false
19/01/2021 08:49:37 - Unsupported debug - navigator.RTCPeerConnection: true
19/01/2021 08:49:37 - Unsupported debug - navigator.RTCIceCandidate: true
19/01/2021 08:49:37 - Unsupported debug - navigator.RTCSessionDescription: true

User Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/137.2.345735309 Mobile/15E148 Safari/604.1
18/01/2021 23:21:22 - Unsupported debug - navigator.mediaDevices: false
18/01/2021 23:21:22 - Unsupported debug - navigator.getUserMedia: false
18/01/2021 23:21:22 - Unsupported debug - navigator.enumerateDevices: false
18/01/2021 23:21:22 - Unsupported debug - navigator.RTCPeerConnection: true
18/01/2021 23:21:22 - Unsupported debug - navigator.RTCIceCandidate: true
18/01/2021 23:21:22 - Unsupported debug - navigator.RTCSessionDescription: true

User Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1
18/01/2021 22:16:10 - Unsupported debug - navigator.mediaDevices: false
18/01/2021 22:16:10 - Unsupported debug - navigator.getUserMedia: false
18/01/2021 22:16:10 - Unsupported debug - navigator.enumerateDevices: false
18/01/2021 22:16:10 - Unsupported debug - navigator.RTCPeerConnection: true
18/01/2021 22:16:10 - Unsupported debug - navigator.RTCIceCandidate: true
18/01/2021 22:16:10 - Unsupported debug - navigator.RTCSessionDescription: true
Seems like a IOS 14.2 issue, as the user agent strings describes.

Someone know what could be?

In a previous search, seems like IOS can deny access to mediaDevices API on not secure ssl context. But our site have a valid ssl certificate, and in our devices works well.

The same code works well for Windows, Mac, Linux, Android and we have just like 20% of users in IOS complaining.

Regards
 

Max

Administrator
Staff member
In a previous search, seems like IOS can deny access to mediaDevices API on not secure ssl context. But our site have a valid ssl certificate, and in our devices works well.
Yes, iOS Safari does not allow mediaDevices API if page is opened via HTTP (not HTTPS) or certificate is invalid. Other browsers do not allow this API via HTTP but may allow via HTTPS with invalid certificate requiring to accpet security exception.
So please check if HTTP is not used anywhere on frontend.
 
Top