Track: WebRTC and Real-Time Applications |
A closer look at the RTCDataChannel API |
This talk will offer attendees an example-driven look at the often under-explored `RTCDataChannel` API. Given all of the challenges and interest around audio and video, data channels find themselves as the short leg of WebRTC’s three-legged streaming stool. The talk will open with a closer look at the range of options available when setting up a new data-channel instance with the `RTCPeerConnection`’s `createDataChannel()` method. The available options will be examined against both browser defaults and browser support—with special attention to the lingering browser-implementation issues surrounding the `Blob` value on `binaryType`. From there, the talk will shift to applied techniques for coordinating multiple data channels within a single WebRTC app. The example provided attendees will be data-channel only, and it will demonstrate the use of multiple data channels working independently of and in concert with one another. The example, which the talk will walk through, will include negotiated and non-negotiated (out-of-band) data channels, data channels that are short- or long-lived, and various strategies for routing incoming data-channel events and data to a specific callback using both data-channel `label` values, as well as the user-definable `protocol` property. The talk will conclude with a look at data-channel features being discussed for the next iteration of the WebRTC specification, especially a proposed `getDataChannels()` method. That method is especially needed, because currently there is no API-native method for retrieving all of the data channels attached to a particular `RTCPeerConnection` object. That predictably places a lot of cognitive load and overhead on developers, who must themselves keep track not only of which channels are opened, but what each channel’s current `readyState` is. |
|
Presentation Video |