Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

fishjam-dev/membrane-webrtc-android

Repository files navigation

Important

This repository is now archived.

All membrane-webrtc-android functionality is now available as part of android-client-sdk

membrane-webrtc-android

Run lint & tests

Components

The repository consists of 2 components:

  • MembraneRTC - Standalone Membrane WebRTC client fully compatible with Membrane RTC Engine bases on a web version responsible for exchanging media events and receiving media streams which then can be presented to the users
  • app - Demo application utilizing MembraneRTC client

MembraneRTC

The main goal of the client was to be as similar to web version as possible. Just like with web client, the native mobile client is pretty raw. It is as low level as possible without exposing any of WebRTC details. It is user's responsibility to keep track of all peers in the room and their corresponding tracks. The client's responsibility is just to notify the user about all the changes regarding the underlying session with the backend server.

What user needs to do is just to provide config necessary for client connection, create local tracks (audio, video or screencast) start the client and listen for any changes via MembraneRTCListener interface.

app

The demo application consists of 2 activities:

  • MainActivity.kt - a room joining screen with 2 inputs for room's name, and participant's display name, and a single join button that when pressed will start the the room activity
  • RoomActivity.kt - the proper room's activity with participant's controls and participants' video feeds

The user has the following control buttons at hand:

  • microphone mute/unmute toggle
  • camera video enable/disable toggle
  • leave call button
  • front/back camera switch
  • screencast toggle

Documentation

API documentation is available here

Necessary setup

The only required constant is the media server's URL that can be found at the top of MainActivity.kt.

Installation

Add jitpack repo to your build.gradle:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Add the dependency:

	dependencies {
	  implementation 'com.github.membraneframework:membrane-webrtc-android:5.0.0'
	}

Developing

  1. Run ./scripts/init.sh in the main directory to install ktlint and release-it and set up git hooks
  2. Set VIDEOROOM_URL in ~/.gradle/gradle.properties to your dev backend.
  3. Run ./gradlew :MembraneRTC:testDebugUnitTest to run unit tests.
  4. Run release-it to release. Follow the prompts, it should add a commit and a git tag and jitpack should pick it up automatically and put the new version in the jitpack repo.

Credits

This project is highly inspired by the LiveKit project and their implementation of the Android SDK and reuses a lot of their implemented solutions (mainly dealing with WebRTC SDK while the signalling got completely replaced with an internal solution).

This project has been built and is maintained thanks to the support from dscout and Software Mansion.

expo sdk

Software Mansion