Home > other >  On the RN implementation full-featured live SDK - react - native - pili
On the RN implementation full-featured live SDK - react - native - pili

Time:09-26




Pili Streaming Cloud React Native SDK
The Introduction

This may be
Is the first
Live in the React on the Native, full-featured SDK, the underlying based on Pili - SDK, the iOS and Android API to unification,
Version 2.0 in order to more easily integrate third-party SDK, the React of the original Native project, manage iOS depends on the adopted Cocoapod, of course, you also can use the original way, after all is can coexist, specific can consult AirApps can see how to integrate, simple example of project is the React - Native - pili,
The Installation
Git clone https://github.com/buhe/pili-startkit YourPorjectName

CD YourPorjectName/js & amp; & NPM install

CD../ios & amp; & Pod install
Javascript
CD YourPorjectName/js
NPM start
IOS

The Open ios/YourPorjectName. Xcworkspace (please note here is Open xcworkspace! Please make sure the)
Just run your project (Cmd + R)
If it is iOS 10 need to add the following additional permissions in the info:

NSCameraUsageDescription
CameraDesciption

NSContactsUsageDescription
ContactsDesciption

NSMicrophoneUsageDescription
MicrophoneDesciption
Android

Using Android open Studio Android
Run marked

The Usage
1. Push flow
RtmpURL={" rtmp://pili-publish.pilitest.qiniucdn.com/pilitest/demo_test? Key=6 eeee8a82246636e}
"Style={{
Height: 400,
Width: 400,
}}
Zoom={1}//zoom
Muted={true}//muted
Focus={false}//focus
The profile={{//video and audio profile
Video: {
FPS: 30,
BPS: 1000 * 1024,
MaxFrameInterval: 48
},
Audio: {
Rate: 44100,
Bitrate: 96 * 1024
},
Started={false}//streaming status
OnReady={()=& gt; {}}//onReady event
OnConnecting={()=& gt; {}}//onConnecting event
OnStreaming={()=& gt; {}}//onStreaming event
OnShutdown={()=& gt; {}}//onShutdown event
OnIOError={()=& gt; {}}//onIOError event
OnDisconnected={()=& gt; {}}//onDisconnected event
/>
2. Live broadcast
Source={{
Uri: "rtmp://pili-live-rtmp.pilitest.qiniucdn.com/pilitest/xxx,"
Timeout: 10 * 1000,//live streaming timeout (ms) Android only
Live: true,//live streaming? Android only
HardCodec: false,//hard codec [it false] Android only
}}
Started={true}//iOS only
Muted={false}//iOS only
Style={{
Height: 200,
Width: 200,
}}
OnLoading={()=& gt; {}}//loading from remote or local
OnPaused={()=& gt; {}}//pause event
OnShutdown={()=& gt; {}}//stopped event
OnError={()=& gt; {}}//the error event
OnPlaying={()=& gt; {}}//play event
/>


CodePudding user response:

  • Related