Skip to content

ossrs/srs-rn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

srs-rn

Example for https://github.com/react-native-webrtc/react-native-webrtc

Prerequisites

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

Usage: WHIPPublisher for iOS

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:

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.

rn-whip

Note: For WHEP player, the application requires permission NSCameraUsageDescription and NSMicrophoneUsageDescription.

Usage: WHEPPlayer for iOS

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.

rn-whep

Note: For WHEP player, the application requires permission NSMicrophoneUsageDescription.