-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
republishing Track fail using Twillio (Was Error: removeTrack() must be called with a RTCRtpSender instance as argument) #569
Comments
@henritoivar thank you, will look into it. |
@henritoivar, this is expected error if removeTrack is not getting an iosRTC RTCRtpSender instance.
It's probably an issue witht the way twilio-video.js manage sender here: Thank to your full example, I should be able to reproduce and handle the issue. |
Note: updated example with missing |
I think this is related #571 |
@hthetiot Thanks a lot. This seems to be a part of the solution. The issue i have now is that unpublishing works, but trying to publish again does not. I have it set up so that i have the example running on the browser with one token and on iOS with another token. When i have the example running both on browsers, then it works. I'll try to dig a bit more to get more details on this. |
The following issue with black remote video is also present: #541 |
I did not get into this issue, probably because I am using twilio 2.4. What version of cordova ios are you running @henritoivar ? Can you try downgrading your twilio version to 2.4.X to see if it fix the issues ? I have no access to my workstation for now, will test it asap. |
@hthetiot I'm still having the same issue with unpublishing and republishing ( video not reappearing on the other side / or black) But it seems i can now work around and avoid using unpublish/publish as i can now use replaceTrack (available in twilio using track.restart) to switch between front/rear camera. Also it seems i can implement muting the video/audio track by using enable/disable track without unpublishing/publishing. @sboudouk I did try using twilio 2.4 and had the same issues. Actually i'm using Capacitor. I will also test this on cordova and get back with the results. |
good to know @henritoivar
if you test its all on master @sboudouk |
I also tested using cordova 10.0.0, cordova-ios 6.1.1. The following issues persist:
You can test it out aswell by cloning this repository: https://github.com/henritoivar/test-iosrtc It's possible to work around restarting the track, but it seems there is some kind of memory leak happening. Probably a result of how the streams are terminated. Something i noticed is that the cordova.plugins.iosrtc.mediaStreams object will contain quite a few stream objects after the call has been closed. I managed to get the video stream showing again on the browser after restarting the track on iOS by using the following hack:
The problem with this hack is that if you switch the camera multiple times, then the app seems to get slower and will finally hangs. Probably a result of the beforementioned memory leak from unpublishing track. |
@henritoivar I wonder what unpublishTrack and publishTrack does, we may need to shim better MediaTrack to fix this issue and prevent your workarround. Notice that the issue with track destruction is fixed on master via cc5bafc and will be released as part of 6.0.14. To test master:
|
related #449 |
@hthetiot Thanks, i'll give it a try. Also something i came upon. Might be unrelated, but maybe something worth taking note of: I was trying to track down why unified plan doesn't work with Twilio. Twilio sets a
The problem here is that I tried hardcoding Twilio to use unified plan, but it seems in that case Twilio is using RTCPeerConnection.addTransceiver which is not yet supported in iosrtc. See the following lines:
Which is later referenced to whether to use addTransceiver (in case of unified-plan) or addTrack (in case of plan-b).
So it seems to get unified-plan working with Twilio we would need Twilio to implement a way of setting isUnifiedPlan from configuration and in iosrtc we would need addTransceiver support. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Regarding unpublishing and then republishing track: I can see a WebSocket message going out that the track is published: In Chrome after this message I also see a message coming in that the track should be published: But in iOS in the incoming message this track has disappeared for some reason: Something to note of also is that the track id(this is the TrackSender/MediaStreamTrack id) and name on Chrome are different, but on iOS name and id of the track are equal. I'm doing some more digging to see why this is happening. @hthetiot Technically the initial error message in this issue is fixed, but there are still issues with republishing a track. Should i create a new issue for the republishing problem, or keep it here? |
That fine Let keep it about republishing a track, still i will release original fix on 6.0.14 in soon. |
see new separate issue #575 |
@hthetiot Thanks a lot. Let me know if i can help anyhow. |
@hthetiot Have you managed to look into this? I'm considering having a go at fixing this. Any pointers are welcome. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Feel free to give it a shoot, it's good to know or understand the source code you depend or use anyway. Notice that if it was that simple I would have fix it already (this issue is going in so many directions it's not even clear for me anymore). |
Please create separate issue @henritoivar there is one for clone already. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@henritoivar Please try this PR see testing instructions: #587 |
@henritoivar can you check #592 |
The last know Twillio issue should have been fixed on #605 that has landed on master target is 6.0.16 Can you test @sboudouk @henritoivar @dgreif we kept Janus fix in place also. |
extra/renderer-and-libwebrtc-tests.js
file).Versions affected
Description
Trying to switch between cameras by unpublishing the previous track and then publishing a new track.
Unpublishing track returns error: removeTrack() must be called with a RTCRtpSender instance as argument
Steps to reproduce
I have adjusted the Twilio sample to implement switching between cameras:
Expected results
Should switch to other camera.
Actual results
Error: removeTrack() must be called with a RTCRtpSender instance as argument
The text was updated successfully, but these errors were encountered: