IOS 12.2 media device error during phone call

Hi
Since updating to IOS 12.2 the ability to stream video during a normal phonecall has changed, if we try to start a stream during the call we get failed to get media devices, we guess this is due to the fact that the microphone is taken/occupied by the normal call . Is there a way to solve this by only asking for the camera on IOS devices ?

We allready have set audio to false in constrains

If we allready have loaded the media devices(camera) and then make a call it works
 

Max

Administrator
Staff member
Hello.
Please clarify: you start a voice call like Phone example, then publish a video stream like Streamer example?
In this case, it's probably a good solution to get access to media devices before making a call, look at Phone Video example source code.
 
Hi Max
It´s just a normal phone call not involving any software, then we publish a stream like the Streamer example, we dont have the option to get access to media before the call only during the call .. There seems to be something that causes it to ask for permission for both camera and mic even if we have set audio to false in constrains, but we only need camera . If we test the https://webrtc.github.io/samples/src/content/getusermedia/gum/ during a call , it only ask for camera permission and that works fine .
So how do we get it to dont ask for microphone like the webrtc sample ?
 
Thanks Max
We really need this to work on IOS 12.2, on older versions it does not fail to "get media device"
We tried different stuff in media device manager examples as well without any luck not matter what we try it always ask for microphone permission
 

Max

Administrator
Staff member
Good day.
We have fixed this issue in WebSDK build 0.5.28.2753.87, please update WebSDK to this build and check.
When audio switched off in constraints
Code:
constraints: {video:true, audio:false}
browser does not request microphone permission, so video publishing works while normal phone call.
 

SLM

Member
Good day.
We have fixed this issue in WebSDK build 0.5.28.2753.87, please update WebSDK to this build and check.
When audio switched off in constraints
Code:
constraints: {video:true, audio:false}
browser does not request microphone permission, so video publishing works while normal phone call.
With 0.5.28.2753.87 I'm getting the following error:

WARN core - TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The provided double value is non-finite.
at getAccess (flashphoner.js:35739)
at flashphoner.js:35705
at new Promise (<anonymous>)
at Object.getMediaAccess (flashphoner.js:35639)
at Object.publish (flashphoner.js:11276)

Createstream is called with these constraints:
audio:
deviceId : ba6bc6a2cb17a18e6123c37314c90a602a9e09d25af72fa1cbfe6f18c5c8a676 (or selected deviceid)

video:
deviceId : d27d238810748be6634e12aba0b041405ecff4c7ee0345d759dba59c5f7e4532 (or selected deviceid)
width : 640
height : 480
minBitrate : 750

Apparently, Flashphoner adds one automatically:
frameRate:
ideal : 30

Maybe this causes this error? Even setting the framerate to another value as part of the constraints parameter keeps the 'ideal' part.

Tested on Chrome, Firefox (desktop) and Safari (iPhone). No such error occurs when using flashphoner-api-0.5.28.2753-f5d57ed655e1a0d4bdc6cab82d29f28738467a85
 

Max

Administrator
Staff member
Good day.
We can't reproduce your issue with WebSDK build 0.5.28.2753.87 (0.5.28.2753-0e77b5a453d667d7201893d939001e904d171d3a) on WCS build 5.2.115 using Media Device example in the following browsers:
Chrome 74.0.3729.131
Firefox 66.0.3
MacOS Safari 12.1 (14607.1.40.1.4)
iOS Safari 12.1 (iOS 12.2)
So please clarify your configuration and, if you have modified Media Device example, please provide us code example modified to reproduce an issue.
 

Peter P.

New Member
Hi,

We have updated to (v.0.5.28.2753-5.2.115-029b46e411ad204fb665705bab23f73579923692 and manually copied the the WebSDK 0.5.28.2753.87

The way we tested it is simply by modifying the manager.js file of the "Media Devices" demo page:
line 284
Code:
var constraints = {
    audio: false,//$("#playAudio").is(':checked'),
    video: $("#playVideo").is(':checked')
};
and line 389
Code:
audio: false,//$("#sendAudio").is(':checked'),
Now it no longer asks for microphone access when we push the "Test" button.
However, it still asks for microphone access when the page loads and this still makes it impossible for us to have a normal phone call while publishing the stream on IOS 12.2.
We can't seem to find where it asks for the microphone on page load. Are there other places we need to modify the example to get this to work?
 

Peter P.

New Member
It works in the "streamer" example because it doesn't ask for microphone permission on page load.
When debugging we can see that it is when getMediaDevices is called it asks for the microphone.
Is it possible to pass some variable to this function to indicate that we don't want access to audio devices?
 

Max

Administrator
Staff member
Good day.
If audio devices access should not be requested while choosing a camera, getMediaDevices() function may be called with explicit constraints setting
Code:
Flashphoner.getMediaDevices(null, true, null, {video: true, audio: false}).then(function (list) {
...list.video.forEach(function (device) {
 ...
 });
}).catch(function (error) {
 $("#notifyFlash").text("Failed to get media devices");
});
 

Peter P.

New Member
Hi Max
Thanks for the quick response! That was exactly what we were looking for, now it works on IOS 12.2 as well.
 

SLM

Member
Good day.
We can't reproduce your issue with WebSDK build 0.5.28.2753.87 (0.5.28.2753-0e77b5a453d667d7201893d939001e904d171d3a) on WCS build 5.2.115 using Media Device example in the following browsers:
Chrome 74.0.3729.131
Firefox 66.0.3
MacOS Safari 12.1 (14607.1.40.1.4)
iOS Safari 12.1 (iOS 12.2)
So please clarify your configuration and, if you have modified Media Device example, please provide us code example modified to reproduce an issue.
The constraint settings are saved in a cookie or localstorage. Only when people want to change the source cam or mic or resolution do these settings get reset.

Media Device example does not reproduce this problem because it resets the constraints _each_ time.
If you just add this to manager.js:
var myconstraints = {
audio: true,
video: {"width":640,
"height":480,
"minBitrate":750
}
};
And then modify line no. 353 with this:
constraints: myconstraints,

You will reproduce this error. Just follow these steps:
1. connect
2. publish
3. stop
4. publish

Result: WARN core - TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The provided double value is non-finite.

If you delete the myconstraints.frameRate.ideal and myconstraints.frameRate if they are not undefined at the time of publishing, the error will not occur, so it definitely is the cause of this error.
 

Max

Administrator
Staff member
Good day.
We cannot reproduce the issue as you describe neither modifying Media Devices example, nor Two Way Streaming (this is simpler to modify because you do not need to set deviceId in constraints) using WebSDK 0.5.28.2753-075cc8b30a361f74b3be6b5f293c528b30e2a5c1 (0.5.28.2753.90) on WCS 5.2.127 in Chrome 74 on Windows and Safari on iOS 12.2.
Please check if you have modified something else. Also check if Media Devices and Two Way Streaming examples on our demo server https://demo.flashphoner.com:8888 works in your environment.
 

SLM

Member
Same result. First publish is ok, stopping and republish returns failed.
Tested on device: iPhone X, iOS 12.1.2 and iPhone 6s, iOS 12.2
Server side: v5.2.58 (Amazon EC2) and v5.0.2971 as well as on the demo.flashphoner.com server (html and javascript on local server though) just a few moments ago.
 

Attachments

Max

Administrator
Staff member
Good day.
We have reproduced this issue (internal ticket WCS-2010) and will inform you when fix it.
As workaround, you can reset constraints on each publishing as Media Devices example.
 
Top