As of Red5 Pro release 2.0.0, Red5 Pro Server includes WebRTC support and front-end integration of the Red5 Pro HTML5 SDK.
WebRTC (Web Real-Time Communication) is supported by the Chrome, Firefox and Opera browsers on desktop. In addition, the Chrome browser on Android supports WebRTC. With iOS 11 and Mac High Sierra, Safari also supports WebRTC (older versions of MacOS and iOS will fall back to HLS). Microsoft Edge support was added with Red5 Pro Release 5.4.0. Internet Explorer does not support WebRTC.
Broadcasting/subscribing of WebRTC to WebRTC, WebRTC to HLS, WebRTC to Flash, and Flash to WebRTC are all supported.
Subscribing to a WebRTC publisher using the Red5 Pro Android or iOS SDK client is supported. In addition, subscribing with WebRTC to a stream published with Red5 Pro Android or iOS SDK client is supported.
WebRTC Broadcaster/Subscriber combinations supported, in a nutshell:
- WebRTC <==> WebRTC
- WebRTC <==> Flash
- WebRTC <==> Red5 Pro iOS SDK
- WebRTC <==> Red5 Pro Android SDK
- WebRTC ==> HLS
WebRTC runs on the standard HTTPS port (443). To run Red5 Pro WebRTC server you need to have a valid SSL Certificate for a registered URL. Red5 Pro with SSL walks you through setting up the certificate on your server. Additionally, as with other Red5 Pro server distributions, you will need to install Java (minimum version 8.0).
If you are running the server, without an SSL cert, on your local machine or on a server:
We recommend running WebRTC on linux, due to CPU and memory requirements. Please see Installing Red5 Pro on an Ubuntu Linux Server
If you want to run Red5 Pro WebRTC on your Windows desktop for development purposes, you will need to install Microsoft Visual Studio redistributables if you don't have Visual Studio on your machine.
If you want to run Red5 Pro WebRTC on your MacOS desktop for development purposes, you may need to install sdl_image. From a terminal window:
brew install sdl_image.
The following Inbound ports need to be open on your server/firewall for Red5 Pro features to work on a WebRTC server using SSL:
|5080||default web access of Red5 Pro; Websockets for WebRTC||TCP|
|443||modified https access of Red5 Pro; secure websockets for WebRTC||TCP|
|1935||default Red5 Pro RTMP port||TCP|
|8554||default RTSP port||TCP|
|6262||websockets for HLS||TCP|
|8081||websockets for WebRTC (severs earlier than 5.4.0)||TCP|
|8083||secure websockets for WebRTC (severs earlier than 5.4.0)||TCP|
|40000-65535||TURN/STUN/ICE port range for WebRTC||UDP|
Most hosted Virtual Machines will have a private and public IP address assigned to the instance. ICE negotiation can run into problems if the server doesn't know which is which.
local.private.ip.address.here with the server's public and private IP addresses, respectively.
# Forcing a public IP address #force.public.ip=yourpublic.ip.address.here # Forcing a private IP address #force.local.ip=local.private.ip.address.here # Configure port availability checking #check.port.availability=true
You can use the Red5 Pro HTML5 SDK to develop your browser-based application. The Red5 Pro HTML5 Streaming Example App contains a simple project with a number of examples that can be used for testing and reference with the Red5 Pro HTML SDK.
The app is also included as a webapp with the server release for developer testing, and can be accessed at
http://localhost:5080/webrtcexamples/ if you are running the server locally).
You will find some more details on the Red5 Pro HTML5 SDK here.
The Red5 Pro broadcaster (
https://yourserverurl/live/broadcast.jsp) and subscriber (
https://yourserverurl/live/subscribe.jsp) use the Red5 Pro HTML5 SDK which allows for fallback player support. Our examples are programmed with the following default fallback order:
You can force the broadcaster to publish with Flash by appending the broadcaster.jsp url with &view=rtmp (e.g.:
http://localhost:5080/live/localhost?host=webrtc.red5.org&view=rtmp). You can do the same with the subscriber, but you must use the individual stream's url (e.g.:
http://localhost:5080/live/viewer.jsp?host=localhoststream=stream&view=rtmp). If you want to force HLS playback you can do that for the subscriber with &view=hls (e.g.:
Here's a very handly link to test what resolutions your webcam supports: webrtchacks.github.io/WebRTC-Camera-Resolution/
This will show you more details on your WebRTC connection, and can help to troubleshoot any issues.
Firefox will prompt you for permissions to access the camera/microphone - at which time you can select your preferred webcam. In Chrome, you will need to select which camera to use via the camera icon in the address bar.