1.2.1 • Published 8 months ago

amazon-ivs-react-native-broadcast v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Amazon IVS React Native Broadcast

A React Native wrapper for the Amazon IVS iOS and Android broadcast SDKs.

npm version npm MIT Platform - Android Platform - iOS

⚠️ Note that the current module implementation doesn't support full functionality provided by Amazon IVS iOS and Android broadcast SDKs.

⚠️ Apps using amazon-ivs-react-native-broadcast must target iOS 11 and Android 12 (API 31).


👉 Read more about broadcasting to Amazon IVS.

👉 See Amazon IVS streaming configuration guideline.

Installation

$ yarn add amazon-ivs-react-native-broadcast
# --- or ---
$ npm install amazon-ivs-react-native-broadcast
$ cd ios && pod install && cd ..

IVSBroadcastCameraView component

Allows consumers to stream video from an active phone camera.

⚠️ Requirements

An application must request permission to access the user’s camera and microphone. This isn't specific to the component but required for any application that needs access to the cameras and microphones.

iOS

Add NSCameraUsageDescription and NSMicrophoneUsageDescription keys to the Info.plist file:

...
<key>NSCameraUsageDescription</key>
<string>In order to stream your awesome video, allow access to camera please</string>
<key>NSMicrophoneUsageDescription</key>
<string>In order to stream your awesome audio, allow access to microphone please</string>
...

Android

Add CAMERA and RECORD_AUDIO permissions to the AndroidManifest.xml file:

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

⚠️ On devices before SDK version 23, the permissions are automatically granted if they appear in the manifest, so check should always result to true and request should always resolve to PermissionsAndroid.RESULTS.GRANTED, however if your app is installed on a device that runs Android 6.0 or higher, you must request the _dangerous permissions at runtime manually._

Example of requesting Android dangerous permissions at runtime could be found in the ./example/src/index.android.tsx file.

API

PropsTypeiOSAndroid
rtmpsUrlstring
streamKeystring
configurationPresetConfigurationPreset?
videoConfigIVideoConfig?
audioConfigIAudioConfig?
logLevelLogLevel?
sessionLogLevelLogLevel?
cameraPreviewAspectModeCameraPreviewAspectMode?
isCameraPreviewMirroredboolean?
cameraPositionCameraPosition?
isMutedboolean?
HandlersTypeiOSAndroid
onError(errorMessage: string): void?
onBroadcastError(error: IBroadcastSessionError): void?
onIsBroadcastReady(isReady: boolean): void?
onBroadcastAudioStats(audioStats: IAudioStats): void?
onBroadcastStateChanged(stateStatus: StateStatusUnion): void?
onBroadcastQualityChanged(quality: number): void?
onNetworkHealthChanged(networkHealth: number): void?
onAudioSessionInterrupted(): void?🚫
onAudioSessionResumed(): void?🚫
onMediaServicesWereLost(): void?🚫
onMediaServicesWereReset(): void?🚫
MethodsTypeiOSAndroid
start(): void
stop(): void

👉 Read more detailed API documentation.

Usage

A complex usage could be found in the ./example/src/App.tsx file or just go to the ./example folder and read Setting up and running application section how to set up and run the example app to see IVSBroadcastCameraView component in action.


License

MIT

1.2.2-rc.1

8 months ago

1.2.1

1 year ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.0-rc1

2 years ago

1.1.0-rc3

2 years ago

1.1.0-rc2

2 years ago

1.2.1-rc.4

1 year ago

1.2.1-rc.3

1 year ago

1.0.1-rc1

2 years ago

1.2.1-rc.2

1 year ago

1.2.1-rc.1

1 year ago

1.2.0-rc.2

2 years ago

1.2.0-rc.1

2 years ago

1.1.1-rc1

2 years ago

1.2.0-rc.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.0

2 years ago