Skip to content

Commit

Permalink
docs(README.md): add info about ApiVideoCameraPreview fit parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Feb 12, 2024
1 parent 94267bc commit f79e0a7
Showing 1 changed file with 38 additions and 21 deletions.
59 changes: 38 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,36 @@ your app.
- [Table of contents](#table-of-contents)
- [Project description](#project-description)
- [Getting started](#getting-started)
- [Installation](#installation)
- [Permissions](#permissions)
- [Code sample](#code-sample)
- [Manage application lifecycle](#manage-application-lifecycle)
- [Installation](#installation)
- [Permissions](#permissions)
- [Code sample](#code-sample)
- [Manage application lifecycle](#manage-application-lifecycle)
- [Example App](#example-app)
- [Setup](#setup)
- [Android](#android)
- [iOS](#ios)
- [Setup](#setup)
- [Android](#android)
- [iOS](#ios)
- [Plugins](#plugins)
- [FAQ](#faq)

<!--</documentation_excluded>-->
<!--<documentation_only>
---
title: Flutter RTMP live stream client
meta:
description: The official Flutter RTMP live stream client for api.video. [api.video](https://api.video/) 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.
meta:
description: The official Flutter RTMP live stream client for
api.video. [api.video](https://api.video/) 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.
---
# Flutter RTMP Live stream Client
[api.video](https://api.video/) 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.
[api.video](https://api.video/) 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.
</documentation_only>-->

## Project description

This module is made for broadcasting RTMP live stream from smartphone camera.
Expand All @@ -47,11 +53,10 @@ This module is made for broadcasting RTMP live stream from smartphone camera.

### Installation

In your pubspec.yaml file, add the following:
Run the following command at the root of your project.

```yaml
dependencies:
apivideo_live_stream: ^1.1.3
```shell
flutter pub add apivideo_live_stream
```

In your dart file, import the package:
Expand All @@ -64,7 +69,7 @@ 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:
1. On Android: ask for internet, camera and microphone permissions:

```xml

Expand All @@ -76,8 +81,9 @@ To be able to broadcast, you must:
```

The library will require android.permission.CAMERA and android.permission.RECORD_AUDIO at runtime.
You don't need to request them.

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

```xml

Expand Down Expand Up @@ -105,12 +111,23 @@ await _controller.initialize();

3. Adds a CameraPreview widget as a child of your view

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

```dart
child: ApiVideoCameraPreview(controller: _controller),
@override
Widget build(BuildContext context) {
return SizedBox(
width: 300.0,
height: 300.0,
child: ApiVideoCameraPreview(controller: _controller));
}
```

`ApiVideoCameraPreview` parameters:

- `controller`: the live stream controller
- `fit`: the fit of the preview (default is BoxFit.contain,
see [BoxFit](https://api.flutter.dev/flutter/painting/BoxFit.html) for more information)
- `child`: a child widget to overlay on top of the preview (optional)

4. Starts a live stream

```dart
Expand Down Expand Up @@ -177,7 +194,7 @@ identifier.

## Plugins

api.video Flutter live stream library is using external native library:
api.video Flutter live stream library is using external native libraries:

| Plugin | README |
|------------|--------------|
Expand All @@ -186,7 +203,7 @@ api.video Flutter live stream library is using external native library:

## FAQ

If you have any questions, ask us in the [community](https://community.api.video). Or
If you have any questions, ask us in the [community](https://community.api.video) or
use [issues](https://github.com/apivideo/api.video-flutter-live-stream/issues).

[//]: # (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)
Expand Down

0 comments on commit f79e0a7

Please sign in to comment.