Opened 5 months ago

Closed 5 months ago

#34263 closed task (fixed)

Library selection for using WebRTC for the project.

Reported by: HashikD Owned by:
Priority: Medium Milestone:
Component: Circumvention/Snowflake Version:
Severity: Normal Keywords: snowflake-mobile
Cc: cohosh, phw, arlolra, dcf, HashikD Actual Points:
Parent ID: #34266 Points:
Reviewer: Sponsor:

Description (last modified by HashikD)

Selecting a good and resilient library with frequent updates is imperative, these are the libraries available:

Google's official library that we have to compile to use in our project: http://webrtc.github.io/webrtc-org/native-code/android/

Ant Server's library: https://github.com/ant-media/Ant-Media-Server/wiki/WebRTC-Android-SDK-Documentation - Here they used "Ant Media Server" as signaling server we can change that.

Ant Media Server uses WebRTC library on top of that they added their own functionality to make it work with Ant Media Server. Which is not very useful for our project.

Child Tickets

Change History (16)

comment:1 Changed 5 months ago by cohosh

Keywords: snowflake-mobile added

comment:2 Changed 5 months ago by cohosh

Add snowflake-mobile keyword to Hashik's GSoC 2020 tickets.

comment:3 Changed 5 months ago by HashikD

Keywords: Snowflake_Android added

comment:4 Changed 5 months ago by HashikD

Compiling WebRTC library and Gradle build dependencies

The latest documentation for WebRTC library is here.

UPDATE: The official documentation is given here is 7 years old at the time of writing and is not up to date.

Last edited 5 months ago by HashikD (previous) (diff)

comment:5 Changed 5 months ago by HashikD

Keywords: Snowflake_Android removed

comment:6 Changed 5 months ago by arlolra

Sorry if this was covered elsewhere but is using pion, like the rest of the snowflake ecosystem, not an option?

comment:7 in reply to:  6 Changed 5 months ago by HashikD

Replying to arlolra:

Sorry if this was covered elsewhere but is using pion, like the rest of the snowflake ecosystem, not an option?

Hello, arlora. There is no Pion pre-built library like Google's WebRTC for Android. If we want to use Pion we have to write a JNI Wrapper ourselves. in the case of the above-said library, it's all already done and ready to use.

More details on how to use Go libraries on Android:
https://medium.com/@AndroidAdvance/running-go-from-android-ios-tutorial-7f1d456c5b0f
http://www.codingvelocity.com/2015/08/08/go-bind-intro.html

Last edited 5 months ago by HashikD (previous) (diff)

comment:8 Changed 5 months ago by cohosh

Cc: HashikD added

comment:9 Changed 5 months ago by HashikD

Description: modified (diff)

comment:10 Changed 5 months ago by HashikD

Adding to my above comment, there are no really good alternatives to Google's Native WebRTC library, even for iOS they use this very same library. All the testing or demo apps that are trying to demonstrate WebRTC use this library (Android/iOS).

If we want to deviate and use another good library, like Pion for instance, we have to write our own JNI wrapper. Besides, this library is good enough and works very fine. It handles asynchronous calls while creating SDP's and ICE trickling, we don't have to handle it manually.

comment:11 Changed 5 months ago by HashikD

Status: newneeds_review

comment:12 in reply to:  6 Changed 5 months ago by cohosh

Replying to arlolra:

Sorry if this was covered elsewhere but is using pion, like the rest of the snowflake ecosystem, not an option?

This is a good place to discuss this. I don't think we need to worry about using a different library for this project. If we were planning on reusing code from the stand-alone proxy-go instances that would be one thing. But given that we have to implement a UI with this (similar to the webextension) it doesn't seem like code sharing is an option.

Another possible advantage to using pion is that it might give us more control if the Chrome WebRTC implementation is fingerprinted and blocked. OTOH, maybe the Chrome WebRTC implementation is more popular with other apps and is less likely to be blocked. Not knowing which way this will go, I'm inclined to go with whichever library is easiest for us to maintain the project.

As far as interoperability, pion has been careful about testing to make sure their code plays well with other WebRTC implementations. If we have problems we should definitely upstream them but I suspect we'll be okay.

comment:13 Changed 5 months ago by cohosh

Status: needs_reviewmerge_ready

We can leave this open for discussion, but I'm good with moving forward with this library for now.

comment:14 Changed 5 months ago by HashikD

Added the library to Gradle. Commit ID: 145c344946a74ecb1533f35ed9590c05485150aa

Github Mirror

comment:15 Changed 5 months ago by HashikD

Parent ID: #34266

comment:16 Changed 5 months ago by cohosh

Resolution: fixed
Status: merge_readyclosed

Okay I'm going to close this now, if something comes up we can reopen or make another ticket :)

Note: See TracTickets for help on using tickets.