-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when holding call: Unable to getUserMedia: getUserMedia(): TypeError, constraints requests no media types #473
Comments
The same behavior in our app after upgrade to v1.0.0. Seems 'hold operation' and 'renegotiation after network switch' do not work (at least on android). Looks like it happened after "Upgrade to video call implementation" (#462), but it requires further investigation... |
Upgrade to video call implementation was mine, i'll have a look into this! |
So the issue seems to be that no media constraints or rtcOfferConstraints are passed in any options maps when hold or undhold is performed. So in rtc_session hold() when it calls sendReInvite I added the following in the map:
getUserMedia() then successfully got 0 tracks. In the resulting invite to the PBX audio was a=sendOnly and the other client started receiving hold music. Although I faced issues when performing unhold() In rtc_session unhold() when it calls _sendReinvite() I added into the options map:
The local stream created from getUserMedia() would contain one audio track but in the following code when adding that audio track to the connection, the print out after adding to check whats in the connection still showed 0. I dont understand why adding the track didnt add the track.
Now further down when the localDescription is made to get the SDP to send off… because there are no local audio stream tracks the resulting SDP audio a=sendOnly still… when it should be a=sendRecv My understanding that in _createLocalDescription() when you call _connection!.createOffer(constraints) if you say in the constraints that you want audio but your connection contains no audio tracks the resulting SDP will still say audio a=sendOnly.
Currently I can’t figure out why the tracks aren’t being added to the stream when I call _connection!.addTrack(track,localStream); |
Any solution? I also facing the same. |
Further progress with this but not quite finished yet. What i was doing wrong in my last comment above is when you put a call on hold, i believe you shouldnt be remove or adding any video or audio streams. So don't mess with any mediaConstraints you only change the rtcOfferConstraints to OfferToReceiveAudio: false for hold and true for unhold that gets passed into _createLocalDescription() so an SDP comes out with the audio tag a=sendOnly (for hold) and then a=sendRecv (for undhold), again leaving the streams in the connection untouched. Id would be great if someone with better understanding than me could confirm this. The initial error of: Is called because in _sendRevinite() when a hold is called its trying to get new audio or video streams when I believe it shouldnt be.. if its a hold or unhold, like i said above we shouldnt alter the streams in the connection. So in my latest work if put into the options when making an un hold or hold 'holdUnholdRequest': true if this is true inside the _sendReinvite() it skips over getuserMedia and adding anything to the streams completely and just goes to _createLocalDescription() and sends off the reinvite. But i still have an issue when coming to unhold. Now we come back into _sendReinvite() without my holdUnHoldRequest true So in sendReinvite ive said the rtcOfferConstraints to the files _rtcOfferConstraints so that iceRestart picks them up. This seems to get further with unhold but somewhere it goes around again sending another invite and setRemoteDescription fails because the state is stable and its unnecessarily trying to do another invite.. Will do further investigation soon. |
Describe the bug
On previous versions calling call.hold() was working, now in version 1.0.0 when I try to hold a call I receive the following
Unable to getUserMedia: getUserMedia(): TypeError, constraints requests no media types
exception = {InvalidStateError}
_stackTrace = null
code = 2
name = "INVALID_STATE_ERROR"
parameter = null
value = null
message = "Invalid status: getUserMedia() failed"
status = "getUserMedia() failed"
but, different from answer and call methods, the hold method does not have parameters to pass the user media.
System Infomation()
Flutter 3.24.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5874a72aa4 (2 weeks ago) • 2024-08-20 16:46:00 -0500
Engine • revision c9b9d5780d
Tools • Dart 3.5.1 • DevTools 2.37.2
Target OS and Version: Android 14
Happening also in the example project
The text was updated successfully, but these errors were encountered: