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/WHIPPublisherInstall dependencies:
npm installInstall pods for iOS:
pod install --project-directory=iosOpen the ios/WHIPPublisher.xcworkspace and setup the development team by Signing & Capabilities > Team:
open ios/WHIPPublisher.xcworkspaceStart application:
npm start iosPress 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.100to 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
NSCameraUsageDescriptionandNSMicrophoneUsageDescription.
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/WHEPPlayerInstall dependencies:
npm installInstall pods for iOS:
pod install --project-directory=iosOpen the ios/WHEPPlayer.xcworkspace and setup the development team by Signing & Capabilities > Team:
open ios/WHEPPlayer.xcworkspaceStart application:
npm start iosPress 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.100to 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.