badge   badge   badge

Flutter 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 module is made for broadcasting RTMP live stream from smartphone camera.

Getting started


In your pubspec.yaml file, add the following:

  apivideo_live_stream: ^1.1.2

In your dart file, import the package:

import 'package:apivideo_live_stream/apivideo_live_stream.dart';


To be able to broadcast, you must:

  1. On Android: ask for internet, camera and microphone permissions:

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

The library will require android.permission.CAMERA and android.permission.RECORD_AUDIO at runtime.

  1. On iOS: update the Info.plist with a usage description for camera and microphone

<key>NSCameraUsageDescription</key><string>Your own description of the purpose</string>

<key>NSMicrophoneUsageDescription</key><string>Your own description of the purpose</string>

Code sample

  1. Creates a live stream controller

final ApiVideoLiveStreamController _controller = ApiVideoLiveStreamController(
    initialAudioConfig: AudioConfig(), initialVideoConfig: VideoConfig.withDefaultBitrate());
  1. Initializes the live stream controller
await _controller.initialize();
  1. Adds a CameraPreview widget as a child of your view

Ensure that _controller.create() has been finished before creating the CameraPreview widget.

child: ApiVideoCameraPreview(controller: _controller),
  1. Starts a live stream
  1. Stops streaming and preview

Manages application lifecycle

On the application side, you must manage application lifecycle:

void didChangeAppLifecycleState(AppLifecycleState state) {
  if (state == AppLifecycleState.inactive) {
  } else if (state == AppLifecycleState.resumed) {

Example App

You can try our example app, feel free to test it.


Be sure to follow the Flutter installation steps before anything.

  1. Open Android Studio
  2. File > New > Project from Version Control

In URL field, type:

[email protected]:apivideo/

Wait for the indexation to finish.


Connect an Android device to your computer and click on the Run main.dart button.


  1. Connect an iOS device to your computer and click on the Run main.dart button.

  2. The build will fail because you haven't set your development profile, sign your application:

Open Xcode, click on "Open a project or file" and open the YOUR_PROJECT_NAME/example/ios/Runner.xcworkspace file.
Click on Example, go in Signin & Capabilities tab, add your team and create a unique bundle identifier.

Plugins Flutter live stream library is using external native library:

StreamPack StreamPack
HaishinKit HaishinKit


If you have any questions, ask us in the community. Or use issues.