Android live stream

Live stream library for Android from


Android RTMP live stream client is the video infrastructure for product builders. Lightning fast
video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in
your app.

Table of contents

Project description

This library is an easy way to broadcast livestream to platform on Android.

Getting started



On build.gradle add the following code in dependencies:

dependencies {
    implementation 'video.api:android-live-stream:1.0.2'


    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />

Your application must dynamically require android.permission.CAMERA
and android.permission.RECORD_AUDIO.

Code sample

  1. Add permissions to your AndroidManifest.xml and request them in your
  2. Add a ApiVideoView to your Activity/Fragment layout for the camera preview.

    android:layout_height="match_parent" />
  1. Implement a ConnectionChecker.
val connectionChecker = object : ConnectionChecker {
    override fun onConnectionSuccess() {
        //Add your code here

    override fun onConnectionFailed(reason: String?) {
        //Add your code here

    override fun onDisconnect() {
        //Add your code here
  1. Creates an ApiVideoLiveStream instance.
class MyFragment : Fragment(), ConnectionChecker {
    private var apiVideoView: ApiVideoView? = null
    private lateinit var apiVideo: ApiVideoLiveStream

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        val apiVideoView = view.findViewById(
        val audioConfig = AudioConfig(
            bitrate = 128 * 1000, // 128 kbps
            sampleRate = 44100, // 44.1 kHz
            stereo = true,
            echoCanceler = true,
            noiseSuppressor = true
        val videoConfig = VideoConfig(
            bitrate = 2 * 1000 * 1000, // 2 Mbps
            resolution = Resolution.RESOLUTION_720,
            fps = 30
        apiVideo =
                context = getContext(),
                connectionChecker = this,
                initialAudioConfig = audioConfig,
                initialVideoConfig = videoConfig,
                apiVideoView = apiVideoView
  1. Start your stream with startStreaming method

For detailed information on this livestream library API, refers
to API documentation.


You can check device supported configurations by using the helper: Helper



We are using external library

Sample application

A demo application demonstrates how to use this livestream library. See /example folder.


If you have any questions, ask us here: . Or use Issues.

Did this page help you?