-
-
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
Task/589/implement addtransceiver #625
Task/589/implement addtransceiver #625
Conversation
* Create native class for transceivers. * Extend js class for transceivers. * Add RTCPeerConnection.addTransceiver. * Set up basic callback for sending native state to js.
* Invoke the native transceiver stop function. * Allow setting direction from JS. * State event for updating the JS state.
@agelito thanks for taking this on. I had made some decent progress, but was waiting on #599 to be merged so that I could build it out in TypeScript. Now that iOS 14.3 has support for native access to |
It might will work on cordova since cordova server from localhost and getUserMedia require https... |
FWIW, the HTTPS requirement does appear to be changing soon WebKit/WebKit@ff60f0a |
This really bad idea I'm surprised that Apple does that... |
@dgreif Thank you, looking at what you've done so far will be of big help. I'll be sure to ask any questions if they come up. |
* Added PluginRTCRtpTransceiver#stringToDirection() * Fixed typo rendonly -> sendonly.
@hthetiot @dgreif Hello, I've made some additional progress with this, being able to do modify for example Some other functions I still have to test/verify is: One issue I have currently is keeping track of the |
Thank you @agelito this PR is scheduled for 8.0 you have a bit of time and we can releases 8 RCx for testing. I also found this that may be interesting for you react-native-webrtc/react-native-webrtc#773 |
Thanks @hthetiot I'll check the react-native-webrtc PR as well. Today I'll do some more testing locally, and try to fix any remaining issues. Also see if I can clean up some of the code, especially the areas around addTransceiver (probably move some code out of constructor to make the function arguments in constructor more streamlined). |
* Instead of having permanent ID's for the JS -> Transceiver association, just have transient ones until the next transceiver state update. Until better solution can be found. * Reduce complexity of transceiver constructor.
Today I've been reworking how the Apart from that I've also been testing, mostly with a local loopback peer connection, but also with a mediasoup based conferencing application. I still received one error on JS side when mediasoup tried to read sender parameters (I think, didn't get much of a callstack). So my natural next step will be to implement the In the mediasoup based conferencing app I'm able to receive video data from a remote peer. But the remote peer isn't able to see video from the iOS device yet. I'll have to keep investigating... My biggest issue today is that some webview worker seem to crash and reload after approximately 10-15 seconds. I'm not sure if this is because of the added transceivers or if it's because of something else. The only clue I have so far is that it seems to be related to DataChannels. I get tons of I'll see if I can provide some actual log output tomorrow (writing from a different computer currently). |
Thank you @agelito for the update. |
For reference: OpenTelecom/WKWebViewRTC#1 (comment) |
* Update sender parameters along with transceivers. * Parse and pass along sendEncodings when doing addTransceiver.
After adding state update for the sender parameters I can both send and receive video/audio in video conferencing app based on MediaSoup (Safari12) adapter. This probably doesn't qualify as an extensive test for feature completeness though, but seems to be at least somewhat working. The web view still crashes after around 10 seconds. So still need to investigate that more. Here's some log output I get on the device around when the crash happens, still no idea what might be causing it: |
I'm fairly confident the crash happens because of some memory leak. |
@hthetiot Small status update: I've done some more testing and it seems the crash I'm experienced is not directly related to the code in this PR. It seems to be the If you're OK with it I can mark this PR ready for review soon? |
@agelito did you identify what api call if called that may cause that, i asume might be getStats, we may implement semaphor |
@agelito ok for me |
@agelito did you manage this also ?
|
@hthetiot I haven't identified which API call causes it yet. I will keep investigating. In the application I'm using there's both simulcast and callstats. Regarding (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection didStartReceivingOnTransceiver:(RTC_OBJC_TYPE(RTCRtpTransceiver) *)transceiver; I'm not sure exactly what should be done when that event happens. Perhaps I can send the transceivers state update when it happens in case any of the data changed. Do you have any idea? |
@hthetiot The API called in iosrtc that causes crash seems to be |
We just tested this branch with IOS ionic and mediasoup-client, this definitely fix the issue. |
That may be a thread related issue or may be i never tested Data-channel on v87 |
Hey @hthetiot. Yes I did try that but it didn't make any difference 🤷♂️ . If you think it should be removed I can remove it. Note: Although the reason of memory leak is still unknown, it was remedied in our case by removing Callstats library. Callstats was causing a lot of data being sent over data channels. |
@agelito I merged master in 7.0.0 and then again in 8.0.0. |
Here is a test branch with master+8+transceiver: |
Tested with Sylaps for iOS all good for me. |
To test 8.0.0 see #545 |
8.0.0 landed on master |
Next release will be 8.0.0. @agelito feel free to make a PR to add your application here: https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/WHO_USES_IT.md |
@olivierb2 can you test master. |
Work in progress Branch implementing the addTransceiver function. Created scaffolding so far and have some TODO comments sprinkled in the code that I will deal with next.
Brief summary of things I need to deal with next (might have missed listing some):