Skip to content

Commit

Permalink
Merge pull request #459 from red5pro/irish-setter-html5
Browse files Browse the repository at this point in the history
Updated with WebRTC SDK 10.0.0 build artifacts
  • Loading branch information
Jessica Palmer authored Jan 31, 2022
2 parents 2eb0a77 + 84915fe commit 77d234b
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 3 deletions.
6 changes: 6 additions & 0 deletions static/lib/red5pro/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changes

## 10.0.0

- update to MUTE API post schema. (Todd Anderson)
- adding Mute API to RTCSubscriber. (Todd Anderson)
- introduction of RTCConferenceParticipant. (bustardcelly)

## 9.1.2

- Fix for `detachView` bug in WebRTC subscriber. (bustardcelly)
Expand Down
99 changes: 98 additions & 1 deletion static/lib/red5pro/CONFERENCE_PARTICIPANT_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,101 @@

---

# RTCConferenceParticipant
# RTCConferenceParticipant in Red5 Pro WebRTC SDK

The `10.0.0` release of the Red5 Pro WebRTC SDK introduced a new client to be used in establishing a connection and streaming session with the Red5 Pro server: `RTCConferenceParticipant`.

The `RTCConferenceParticipant` is an extension of `RTCPublisher` that receives additional tracks to playback multiple audio sources along with a single composited video of all participants in the conference group.

> Read more about an `RTCPublisher` from the [Publisher Documentation](PUBLISHER_README.md)
The `RTCConferenceParticipant` differs from a `RTCPublisher` in that it requests to join a conference room while simulataneuosly starting a broadcast. Once the `RTCConferenceParticipant` has joined the room it is delivered 3 `recvonly` audio tracks and 1 `recvonly` video track.

The 3 audio tracks are considered the "loudest talkers" minus the current audio being broadcast out - typically referred to as a "mix-minus".

The 1 video track is a video composite of the video streams of all the `RTCConferenceParticipant`s in the group conference. Because of this, integrating a `RTCConferenceParticipant` into your application will most likely require a Mixer Node.

> Read more about the [Red5 Pro Mixer](https://www.red5pro.com/docs/special/mixer/using-mixer/#gatsby-focus-wrapper).
* [Requirements](#requirements)
* [Configuration Parameters](#configuration-parameters)
* [Events](#events)
* [Example](#example)

# Requirements

## Mixer Node

Because the video delivered to each `RTCConferenceParticipant` is a composite of all participants in the conference group, you will most likely need to deploy a [Red5 Pro Mixer] (https://www.red5pro.com/docs/special/mixer/using-mixer/#gatsby-focus-wrapper) as part of your solution.

## Group Provision

Before Joining a Conference Group as a Participant, a Group Provision needs to be available on the server.

Here is an example of a provision to POST to the server:

```json
{
guid: 'live',
context: 'live',
name: 'group01',
level: 0,
isRestricted: false,
parameters: {
group: 'webrtc',
audiotracks: 3,
videotracks: 1
},
restrictions: [],
primaries: [],
secondaries: []
}
```

Where the `context` is the application context you are streaming to (default is `live`) and `name` is the name of the Conference Group.

To post the provision, make a HTTP POST request to the server endpoint using:

```
https://<your-red5pro-deployment>/cluster/api?action=provision.create
```

# Configuration Parameters

The `RTCConferenceParticipant` is an extension of `RTCPublisher`. As such, it has the same configuration parameters along with the following additional:

| Property | Required | Default | Description |
| :--- | :---: | :---: | :--- |
| groupName | [x] | `group01` | The name of the conference group the participant will be joining. |

# Events

The `RTCConferenceParticipant` is an extension of `RTCPublisher`. As such, it has the same lifecycle events with the following additional accessible from the `RTCConferenceParticipantEventTypes` object:

| Access | Name | Meaning |
| :--- | :---: | :--- |
| RTCConferenceParticipantEventTypes.MEDIA_STREAM | `Conference.MediaStream` | The event will be fired once the `MediaStream` assembled with the 3 audio tracks and 1 composite video track is delivered to the `RTCConferenceParticipant`. The `MediaStream` will be accessible from the event on `data.stream` and can be used to assign as the `srcObject` to an HTML `video` element for playback. |

# Example

The following is an example of creating a `RTCConferenceParticipant` and requesting to join a group broadcast.

> Note the `app` init configuration attribute is a combination of the `live` app context and the group name.
```js
import { RTCConferenceParticpant } from 'red5pro-webrtc-sdk'

const start = async () => {
const participant = new RTCConferenceParticipant()
participant.on('Conference.MediaStream', event => {
const { data: { stream } } = event
conferenceVideoElement.srcObject = stream
})
await participant.init({
streamName: 'participant1',
groupName: 'group01',
app: 'live/group01'
})
await participant.publish()
}
```
Binary file modified static/lib/red5pro/red5pro-publisher.swf
Binary file not shown.
4 changes: 2 additions & 2 deletions static/lib/red5pro/red5pro-sdk.min.js

Large diffs are not rendered by default.

Binary file modified static/lib/red5pro/red5pro-subscriber.swf
Binary file not shown.

0 comments on commit 77d234b

Please sign in to comment.