Android native client support

Planning to add android native client support and android client demo which can communicate with the mediasoup-demo’s server part. Wondering if it is needed or whether someone else is working on it?

It would be extremely good to have an Android app that uses libmediasoupclient and connects to the mediasoup-demo server.

As you can see, we have developed and released libmediasoupclient, but there are not Android/iOS bindings for it. AFAIS there are two options:

  1. Create libmediasoupclient bindings for Android and iOS. This is, the API exposed by libmediasoupclient wrapped in Java and ObjetiveC or Swift.
  2. Do not create those bindings and instead make each application directly use the C++ API exposed by libmediasoupclient.

I assume the way to go is 1. So if you go that way, and then create an Android demo app, it would be great.

In the other side, we need some help improving the libmediasoupclient build system. Currently it depends on CMake and it depends on static libraries (libwebrtc, libsdptransform) and produces a static library. Not sure if that would work in Android/iOS environments.

Yep, the way to go is 1. The static library is OK for Android, and the good news is that Android Studio supports using CMake to compile C and C++ code. I’ll work on the Android support and demo app.

There will have two projects mediasoup-client-android and protoo-client-android.Temporarily, is it ok to create this repo under my GitHub account and use org.mediasoup.droid as the package name?

Just take into account that protoo is completely unrelated to mediasoup. Of course, you need it to interact with the mediasoup-demo at WebSocket level.

Which exact repo do you mean? I understand there are 3 repos:

  1. mediasoup-client-android
  2. protoo-client-androir
  3. mediasoup-demo-android (not sure about the name)

2 repos are just ok, I meant that mediasoup-demo-android could be put into subdirectory of mediasoup-client-android. But 3 repos seems better and create all these 3 repos under my Github account.

mediasoup-client-android package name org.mediasoup.droid
protoo-client-android package name org.mediasoup.droid.protoo
mediasoup-demo-android package name org.mediasoup.droid.demo

If possible, please do not include the demo app into the mediasoup-client Android SDK :slight_smile:

We do not need that protoo-client for Android is associated with “mediasoup.org” at all. Can you please use any other namespace? You can use org.protoojs.droid instead.

Got it. I’ll start working on it.

1 Like

BTW I’ll mention your work on Januscon in Napoli next week :slight_smile:

Update:

Still, I need several weeks to complete this task. :thinking:

1 Like

Amazing!

Looks promising!

A big step forward, update:

From now on move to the next step mediasoup-demo-android, but still, need several weeks.

Awesome! please update us with news when appropriate. We’ll try to follow it.

Although still a work in progress, I have also started on working on an android demo app.
I have managed to get to the point where I can publish a stream from android.
I’ll link the repository below, although it is still a work in progress:

So far no issues with the Android SDK. :slight_smile:
Really great job!

1 Like

Awesome! any issue please let me you. BTW I’ve already started two repo, one is protoo-android-client the other is mediasoup-android-demo, and let’s work in parallel. :shushing_face:

1 Like

@haiyangwu
I’ve managed to get as far as playing a remote audio consumer without any issues.
However because Consumer does not implement the getNativeTrack methods, I am unable to play the remote video consumer. :worried:

Would this be hard to implement?

@ethand91,

I don’t know about getNativeTrack, and it’s not present in libwebrtc. Could you please elaborate why you are unable to play the remote video consumer?

@jmillan
We need to pass the consumer.getTrack from libmediasoup to the Android side via JNI in order to play it.
(c++ consumer.getTrack() -> JNI consumer.getNativeTrack() and getTrack() -> Android consumer.getTrack())

At the moment the JNI API for the consumer.getTrack() has not been implemented, so it’s impossible to get the consumer’s track on the Android side.

@ethand91 I’ll implement the getTrack method and give u a update.

1 Like

@ethand91 A new commit, implement the Consumer#getTrack has pushed to the repo. :vulcan_salute:

1 Like