Example for https://github.com/react-native-webrtc/react-native-webrtc
You must have a WHIP service, you can build one by following tutorial Effortlessly Create a Public Internet WHIP Service for OBS: A Comprehensive Guide to Sub-Second Streaming
For more information about WebRTC streaming, WHIP, and WHEP, please read WebRTC Streaming
Make sure you have completed the React Native - Setting up the development environment
instructions till Creating a new application
step, before proceeding.
Clone code and change to directory:
git clone https://github.com/ossrs/srs-rn.git
cd srs-rn/WHIPPublisher
Install dependencies:
npm install
Install pods for iOS:
pod install --project-directory=ios
Open the ios/WHIPPublisher.xcworkspace
and setup the development team by Signing & Capabilities > Team
:
open ios/WHIPPublisher.xcworkspace
Start application:
npm start ios
Press i
to run on iOS. Click the Start
button, which publish stream via WHIP
and view stream by browser via WHEP:
- WHIP:
http://192.168.1.100:1985/rtc/v1/whip/?app=live&stream=livestream
- WHEP: http://192.168.1.100:1985/rtc/v1/whep/?app=live&stream=livestream
Note: Please change the IP address
192.168.1.100
to your own WebRTC service IP address.
You can also use other WHEP player to view the steam.
Note: For WHEP player, the application requires permission
NSCameraUsageDescription
andNSMicrophoneUsageDescription
.
Make sure you have completed the React Native - Setting up the development environment
instructions till Creating a new application
step, before proceeding.
Clone code and change to directory:
git clone https://github.com/ossrs/srs-rn.git
cd srs-rn/WHEPPlayer
Install dependencies:
npm install
Install pods for iOS:
pod install --project-directory=ios
Open the ios/WHEPPlayer.xcworkspace
and setup the development team by Signing & Capabilities > Team
:
open ios/WHEPPlayer.xcworkspace
Start application:
npm start ios
Press i
to run on iOS. Publish stream by browser or OBS via WHIP. Click the Start
button, which play stream via
WHEP:
- WHIP:
http://192.168.1.100:1985/rtc/v1/whip/?app=live&stream=livestream
- WHEP:
http://192.168.1.100:1985/rtc/v1/whep/?app=live&stream=livestream
Note: Please change the IP address
192.168.1.100
to your own WebRTC service IP address.
You can also use other WHIP application to publish the steam.
Note: For WHEP player, the application requires permission
NSMicrophoneUsageDescription
.