Skip to content

Commit

Permalink
Merge branch 'master' into eslint-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jianjunz authored Feb 19, 2020
2 parents 56fa107 + 6d6d0a4 commit 8953ff5
Show file tree
Hide file tree
Showing 33 changed files with 848 additions and 365 deletions.
4 changes: 2 additions & 2 deletions docs/jsdoc/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"recurseDepth": 10,
"source": {
"include": "src/sdk",
"exclude": ["src/sdk/rest", "src/sdk/nuve", "src/sdk/ui"],
"exclude": ["src/sdk/rest", "src/sdk/ui"],
"excludePattern": "w*.legacy.*"
},
"sourceType": "module",
Expand All @@ -17,7 +17,7 @@
"dateFormat": "ddd MMM Do YYYY",
"outputSourceFiles": false,
"outputSourcePath": false,
"systemName": "Intel® Collaboration Suite for WebRTC version 4.2.1",
"systemName": "Intel® Collaboration Suite for WebRTC version 4.3",
"footer": "",
"copyright": "Copyright © 2019 Intel Corporation. All Rights Reserved.",
"navType": "vertical",
Expand Down
5 changes: 5 additions & 0 deletions docs/mdfiles/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Change Log
==========
# 4.3
* The type of `conferenceClient.publish` method's option is changed from `AudioEncodingParameters` and `VideoEncodingParameters` to `RTCRtpSendParameters`.
* `audio` and `video` of `PublicationSettings` is changed from `AudioPublicationSettings` and `VideoPublicationSettings` to `AudioPublicationSettings` array and `VideoPublicationSettings` array.
* Add `rid` to `VideoSubscriptionConstraints`. When `rid` is specified, other constraints will be ignored.

# 4.0.2
* Fix a compatibility issue for Chrome 69 beta.

Expand Down
98 changes: 88 additions & 10 deletions docs/mdfiles/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Conference Mode:

| | Windows* | Ubuntu* | macOS* |
| ------------------------------- | -------- | ------- |------- |
| Chrome* 73 ||||
| Firefox* 66 ||||
| Safari* 12 | | ||
| Microsoft Edge* 44.17763.1.0 || | | |
| Chrome* 78 ||||
| Firefox* 70 ||||
| Safari* 13 | | ||
| Microsoft Edge* 44.18362.387.0 || | | |

*Table 1: Browser requirements for Conference Mode*

Expand All @@ -30,9 +30,9 @@ P2P Mode:

| | Windows* | Ubuntu* | macOS* |
| ------------------------------- | -------- | ------- |------- |
| Chrome* 73 ||||
| Firefox* 66 ||||
| Safari* 12 | | ||
| Chrome* 78 ||||
| Firefox* 70 ||||
| Safari* 13 | | ||

*Table 2: Browser requirements for P2P Mode*

Expand Down Expand Up @@ -68,11 +68,89 @@ Signaling channel is an implementation to transmit signaling data for creating a

In the customized signaling channel, you need to implement `connect`, `disconnect` and `send`, invoke `onMessage` when a new message arrives, and invoke `onServerDisconnected` when the connection is lost. Then include your customized `sc.*.js` into the HTML page.

# 5 Events
# 5 Conference mode

The JavaScript objects fires events using `Ics.Base.EventDispatchers`. For more detailed events, please refer to the specific class description page.
Conference mode is designed for applications with multiple participants through MCU conference server. To enable conference chat, copy and paste the following code into the head section of your HTML document:
~~~~~~{.js}
<script type="text/javascript" src="socket.io.js"></script>
<script type="text/javascript" src="adapter.js"></script>
<script type="text/javascript" src="owt.js"></script>
~~~~~~

The JavaScript SDK includes a demo application for whole conferencing workflow with operations including join room, publish and subscribe streams, etc. Moreover, the conference server also supports simulcast. This can be enabled through JavaScript SDK.

## 5.1 Publish a simulcast stream
~~~~~~{.js}
// Example of simulcast publication.
conference = new Owt.Conference.ConferenceClient();
// ...
conference.join(token).then(resp => {
// ...
Owt.Base.MediaStreamFactory.createMediaStream(new Owt.Base.StreamConstraints(
audioConstraints, videoConstraints)).then(stream => {
/*
* Use `RTCRtpEncodingParameters` as publish option
* (https://w3c.github.io/webrtc-pc/#dom-rtcrtpencodingparameters).
* The following option would create 3 streams with resolutions if browser supports:
* OriginResolution, OriginResolution/2.0 and OriginResolution/4.0.
* For current Firefox, the resolutions should be sorted in descending order(reversed sample's option).
* For current Safari, legacy simulcast is used and the parameters like `rid` won't take effect.
* Besides `scaleResolutionDownBy`, other `RTCRtpEncodingParameters` can be set
* if browser supports.
* The actual output will be determined by browsers, the outcome may not be exactly same
* as what is set in publishOption, e.g. For a vga video stream, there may be 2 RTP streams
* rather than 3.
*/
const publishOption = {video:[
{rid: 'q', active: true, scaleResolutionDownBy: 4.0},
{rid: 'h', active: true, scaleResolutionDownBy: 2.0},
{rid: 'f', active: true, scaleResolutionDownBy: 1.0}
]};
/*
* Codec priority list.
* Here 'vp8' will be used if enabled.
*/
const codecs = ['vp8', 'h264'];
localStream = new Owt.Base.LocalStream(
stream, new Owt.Base.StreamSourceInfo(
'mic', 'camera'));
conference.publish(localStream, publishOption, codecs).then(publication => {
// ...
});
});
~~~~~~

## 5.2 Subscribe a simulcast stream
~~~~~~{.js}
// Example of subscription.
conference = new Owt.Conference.ConferenceClient();
// ...
conference.join(token).then(resp => {
// ...
/*
* Subscribe simulcast stream with specified `rid`
* which can be found in `RemoteStream.settings.video[i].rid`.
* If `rid` is set when subscribing, other parameters will be ignored.
*/
const subscribeOption = {
audio: true,
video: {rid: 'q'}
};
conference.subscribe(remoteStream, subscribeOption).then((subscription) => {
// ...
});
~~~~~~

**Note**:
a. The simulcast stream published to conference won't be transcoded.
b. The `rid` attribute may not be present once a 'streamadded' event triggered. Users should listen on stream's `updated` event for new `rid` added.
c. Current browsers support VP8 simulcast well while H.264 simulcast has some limitations.

# 6 Events

The JavaScript objects fires events using `Owt.Base.EventDispatchers`. For more detailed events, please refer to the specific class description page.

# 6 Privacy and security
# 7 Privacy and security
SDK will send operation system's name and version, browser name, version and abilities, SDK name and version to conference server and P2P endpoints it tries to make connection. SDK does not store this information on disk.

**Note:** \* Other names and brands may be claimed as the property of others.
Loading

0 comments on commit 8953ff5

Please sign in to comment.