{"id":18498047,"url":"https://github.com/apivideo/api.video-flutter-live-stream","last_synced_at":"2025-04-05T10:08:07.609Z","repository":{"id":39584227,"uuid":"413728814","full_name":"apivideo/api.video-flutter-live-stream","owner":"apivideo","description":"Flutter RTMP live stream client. Made with ♥ by api.video","archived":false,"fork":false,"pushed_at":"2025-01-29T09:43:15.000Z","size":566,"stargazers_count":71,"open_issues_count":19,"forks_count":46,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T09:10:35.966Z","etag":null,"topics":["client","flutter","livestream","rtmp"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apivideo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-05T08:10:37.000Z","updated_at":"2025-03-17T00:26:18.000Z","dependencies_parsed_at":"2025-03-29T09:10:25.469Z","dependency_job_id":"ca7639e8-db74-4752-979d-94d77c25cc16","html_url":"https://github.com/apivideo/api.video-flutter-live-stream","commit_stats":{"total_commits":112,"total_committers":5,"mean_commits":22.4,"dds":0.4107142857142857,"last_synced_commit":"0f0391c9351eeadf2bd1df453ca229a946d7ea99"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apivideo%2Fapi.video-flutter-live-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apivideo%2Fapi.video-flutter-live-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apivideo%2Fapi.video-flutter-live-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apivideo%2Fapi.video-flutter-live-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apivideo","download_url":"https://codeload.github.com/apivideo/api.video-flutter-live-stream/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318744,"owners_count":20919484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","flutter","livestream","rtmp"],"created_at":"2024-11-06T13:37:21.851Z","updated_at":"2025-04-05T10:08:07.589Z","avatar_url":"https://github.com/apivideo.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\u003cdocumentation_excluded\u003e--\u003e\n[![badge](https://img.shields.io/twitter/follow/api_video?style=social)](https://twitter.com/intent/follow?screen_name=api_video)\n\u0026nbsp; [![badge](https://img.shields.io/github/stars/apivideo/api.video-flutter-live-stream?style=social)](https://github.com/apivideo/api.video-flutter-live-stream)\n\u0026nbsp; [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video)\n![](https://github.com/apivideo/.github/blob/main/assets/apivideo_banner.png)\n\n\u003ch1 align=\"center\"\u003eFlutter RTMP live stream client\u003c/h1\u003e\n\n[api.video](https://api.video) is the video infrastructure for product builders. Lightning fast\nvideo APIs for integrating, scaling, and managing on-demand \u0026 low latency live streaming features in\nyour app.\n\n## Table of contents\n\n- [Table of contents](#table-of-contents)\n- [Project description](#project-description)\n- [Getting started](#getting-started)\n    - [Installation](#installation)\n    - [Permissions](#permissions)\n    - [Code sample](#code-sample)\n        - [Manage application lifecycle](#manage-application-lifecycle)\n- [Example App](#example-app)\n    - [Setup](#setup)\n        - [Android](#android)\n        - [iOS](#ios)\n- [Plugins](#plugins)\n- [FAQ](#faq)\n\n\u003c!--\u003c/documentation_excluded\u003e--\u003e\n\u003c!--\u003cdocumentation_only\u003e\n---\ntitle: Flutter RTMP live stream client\nmeta:\ndescription: The official Flutter RTMP live stream client for\napi.video. [api.video](https://api.video/) is the video infrastructure for product builders.\nLightning fast video APIs for integrating, scaling, and managing on-demand \u0026 low latency live\nstreaming features in your app.\n---\n\n# Flutter RTMP Live stream Client\n\n[api.video](https://api.video/) is the video infrastructure for product builders. Lightning fast\nvideo APIs for integrating, scaling, and managing on-demand \u0026 low latency live streaming features in\nyour app.\n\n\u003c/documentation_only\u003e--\u003e\n\n## Project description\n\nThis module is made for broadcasting RTMP live stream from smartphone camera.\n\n## Getting started\n\n### Installation\n\nRun the following command at the root of your project:\n\n```shell\nflutter pub add apivideo_live_stream\n```\n\nIn your dart file, import the package:\n\n```dart \nimport 'package:apivideo_live_stream/apivideo_live_stream.dart';\n```\n\n### Permissions\n\nTo be able to broadcast, you must:\n\n1. On Android: ask for internet, camera and microphone permissions:\n\n```xml\n\n\u003cmanifest\u003e\n    \u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n    \u003cuses-permission android:name=\"android.permission.RECORD_AUDIO\" /\u003e\n    \u003cuses-permission android:name=\"android.permission.CAMERA\" /\u003e\n\u003c/manifest\u003e\n```\n\nThe library will require android.permission.CAMERA and android.permission.RECORD_AUDIO at runtime.\nYou don't need to request them.\n\n2. On iOS: update the Info.plist with a usage description for camera and microphone\n\n```xml\n\n\u003ckey\u003eNSCameraUsageDescription\u003c/key\u003e\n\u003cstring\u003eYour own description of the purpose\u003c/string\u003e\n\u003ckey\u003eNSMicrophoneUsageDescription\u003c/key\u003e\n\u003cstring\u003eYour own description of the purpose\u003c/string\u003e\n```\n\n### Code sample\n\n1. Creates a live stream controller\n\n```dart\n\nfinal ApiVideoLiveStreamController _controller = ApiVideoLiveStreamController(\n    initialAudioConfig: AudioConfig(), initialVideoConfig: VideoConfig.withDefaultBitrate());\n```\n\n2. Initializes the live stream controller\n\n```dart\nawait _controller.initialize();\n```\n\n3. Adds a CameraPreview widget as a child of your view\n\n```dart\n@override\nWidget build(BuildContext context) {\n  return SizedBox(\n      width: 300.0,\n      height: 300.0,\n      child: ApiVideoCameraPreview(controller: _controller));\n}\n```\n\n`ApiVideoCameraPreview` parameters:\n\n- `controller`: the live stream controller\n- `fit`: the fit of the preview (default is BoxFit.contain,\n  see [BoxFit](https://api.flutter.dev/flutter/painting/BoxFit.html) for more information)\n- `child`: a child widget to overlay on top of the preview (optional)\n\n4. Starts a live stream\n\n```dart\n_controller.startStreaming(\"YOUR_STREAM_KEY\");\n```\n\n5. Stops streaming and preview\n\n```dart\n_controller.stop();\n```\n\n#### Manage application lifecycle\n\nOn the application side, you must manage application lifecycle:\n\n```dart\n@override\nvoid didChangeAppLifecycleState(AppLifecycleState state) {\n  if (state == AppLifecycleState.inactive) {\n    _controller.stop();\n  } else if (state == AppLifecycleState.resumed) {\n    _controller.startPreview();\n  }\n}\n```\n\n## Example App\n\nYou can try\nour [example app](https://github.com/apivideo/api.video-flutter-live-stream/tree/master/example),\nfeel free to test it.\n\n### Setup\n\nBe sure to follow the [Flutter installation steps](https://docs.flutter.dev/get-started/) before\nanything.\n\n1) Open Android Studio\n2) File \u003e New \u003e Project from Version Control\n\nIn URL field, type:\n\n```shell\ngit@github.com:apivideo/api.video-flutter-live-stream.git\n```\n\nWait for the indexation to finish.\n\n#### Android\n\nConnect an Android device to your computer and click on the `Run main.dart` button.\n\n#### iOS\n\n1) Connect an iOS device to your computer and click on the `Run main.dart` button.\n\n2) The build will fail because you haven't set your development profile, sign your application:\n\nOpen Xcode, click on \"Open a project or file\" and open\nthe `YOUR_PROJECT_NAME/example/ios/Runner.xcworkspace` file.\n\u003cbr /\u003eClick on Example, go in `Signin \u0026 Capabilities` tab, add your team and create a unique bundle\nidentifier.\n\n## Plugins\n\napi.video Flutter live stream library is using external native libraries:\n\n| Plugin     | README       |\n|------------|--------------|\n| StreamPack | [StreamPack] |\n| HaishinKit | [HaishinKit] |\n\n## FAQ\n\nIf you have any questions, ask us in the [community](https://community.api.video) or\nuse [issues](https://github.com/apivideo/api.video-flutter-live-stream/issues).\n\n[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)\n\n[StreamPack]: \u003chttps://github.com/ThibaultBee/StreamPack\u003e\n\n[HaishinKit]: \u003chttps://github.com/shogo4405/HaishinKit.swift\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapivideo%2Fapi.video-flutter-live-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapivideo%2Fapi.video-flutter-live-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapivideo%2Fapi.video-flutter-live-stream/lists"}