Skip to content

Commit

Permalink
docs(README.md): update infos for permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Mar 1, 2024
1 parent 8dd2aae commit 3a7f6a0
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
- [Getting started](#getting-started)
- [Installation](#installation)
- [Permissions](#permissions)
- [Android](#android)
- [iOS](#ios)
- [Code sample](#code-sample)
- [Documentation](#documentation)
- [Props \& Methods](#props--methods)
- [Example App](#example-app)
- [Setup](#setup)
- [Android](#android)
- [iOS](#ios)
- [Android](#android-1)
- [iOS](#ios-1)
- [Plugins](#plugins)
- [FAQ](#faq)

Expand All @@ -41,13 +43,10 @@ meta:
</documentation_only>-->
## Project description

This module is made for broadcasting rtmp live stream from smartphone camera
This module is made for broadcasting RTMP live stream from smartphone camera

## Getting started

:warning: **The React Native Live Stream SDK is designed for 0.69.1 version of React Native. Using the SDK with >0.69.1 of React Native can cause unexpected behaviour**


### Installation

```sh
Expand All @@ -60,33 +59,25 @@ or
yarn add @api.video/react-native-livestream
```

_Note: if you are on iOS, you will need two extra steps:_

1. Don't forget to install the native dependencies with Cocoapods

```sh
cd ios && pod install
```

1. This project contains swift code, and if it's your first dependency with swift code, you need to create an empty swift file in your project (with the bridging header) from XCode. [Find how to do that](https://github.com/apivideo/api.video-reactnative-live-stream/blob/main/docs/install_swift_dependency.md)

### Permissions

To be able to broadcast, you must:
#### Android

Permissions `android.permission.RECORD_AUDIO`, `android.permission.CAMERA` and `android.permission.INTERNET` are in the library manifest and will be requested by this library at runtime. You don't have to request them in your application.

1. On Android: ask for internet, camera and microphone permissions:
For the PlayStore, your application might declare this in its `AndroidManifest.xml`

```xml

<manifest>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
</manifest>
```

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

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

```xml
<key>NSCameraUsageDescription</key>
Expand All @@ -96,8 +87,6 @@ Your application must dynamically require android.permission.CAMERA and android.
<string>Your own description of the purpose</string>
```

3. On react-native you must handle the permissions requests before starting your livestream. If permissions are not accepted you will not be able to broadcast.

### Code sample

```jsx
Expand Down

0 comments on commit 3a7f6a0

Please sign in to comment.