Requirements
- A valid Red5 Pro SDK license key
- Camera and microphone permissions for publishing
- Internet permission for both publishing and subscribing
- Android API level compatible with the WebRTC dependency
Installation
Download the Android Archive (.aar) from red5-cloud-sdk.cachefly.net and place it in your app/libs folder.
Add the following dependencies to your app’s build.gradle:
Permissions
Add the following to yourAndroidManifest.xml:
Minimal publish
1
Add a Red5Renderer to your layout
Red5Renderer extends WebRTC’s SurfaceViewRenderer and displays the local camera preview.2
Request camera and microphone permissions
3
Build the client
Use
IRed5WebrtcClient.builder() and chain your configuration. Use setStreamManagerHost() for Red5 Cloud or setServerIp() for a standalone server.- Java
- Kotlin
4
Start preview after license validates
5
Publish
Minimal subscribe
Camera controls
Call these methods on theIRed5WebrtcClient instance at any time after the client is built.
Picture-in-Picture mode
The SDK supports Android’s native PiP mode for both publishing and subscribing. Auto-enter PiP when the user navigates away:Real-time stats collection
Enable the stats collector to receive WebRTC metrics every 2 seconds (configurable).onRtcStats() in your Red5EventListener:
Conferencing
The SDK provides multi-party conferencing via Red5 Cloud.Conferencing requires a Red5 Cloud (Stream Manager) deployment. It does not work with standalone servers.
1
Set a ConferenceListener and build the client
2
Join the room
3
Leave the room
Chat integration
The SDK includes built-in PubNub chat. Pass your PubNub keys when building the client:Red5EventListener:
Event reference
ImplementIRed5WebrtcClient.Red5EventListener in your Activity or Fragment.
Streaming events
Streaming events
Lifecycle events
Lifecycle events
Chat events
Chat events
Configuration reference
KeyIRed5WebrtcClient.builder() methods:
For the complete API reference including all methods, enums, and data models, see the Android SDK API reference.
