HomeGuidesAPI Reference
HubBlogChangelogSupport ForumLog In
API Reference

Web SDK - InboundStream

Home > @rainway/web > InboundStream

InboundStream class

An incoming Rainway stream.

To ask a host for a stream, use Peer.createStream(). You can also listen for unsolicited stream announcements using the stream event on Peer. To clean up, call InboundStream.close().

For more info, see: https://docs.rainway.com/tutorial/streaming

Signature:

export declare class InboundStream extends EventEmitter<StreamEvents> 

Extends: EventEmitter<StreamEvents

Properties

PropertyModifiersTypeDescription
containerreadonlyHTMLDivElementA DOM node containing the stream. Attach this anywhere on your page to display this stream.
endedreadonlybooleanIndicates that this stream has ended, and the RainwayStream object should be discarded.
idnumberA number identifying this stream among the host's streams.
peerPeerThe Peer hosting this stream.
permissionsreadonlyInputLevelA bitmask indicating the granted level of interactive control available over the remote stream.
streamFitreadonlyStreamFit

The current setting for how the stream container fits isolated apps.

- IsolatedApps makes the stream fit only the bounding rectangle of all windows belonging to the isolated app. The stream picture might grow and shrink as this rectangle changes. This is the default setting.

- FullDesktop makes the entire desktop always be streamed, even in the App Isolation capture mode. This might cause the stream container to have a large border of empty space around the isolated app.

Methods

MethodModifiersDescription
close()Stop consuming the stream. The container is cleared. This also sends a message to the remote end indicating that we are no longer interested in this stream.
disableGestures()

Stop gesture processing of touch inputs on the stream container. (It is enabled by default.)

A touch input will be simply translated into an absolute-coordinate click-and-drag mouse input.

disableVideoStatsOverlay()Disable the video statistics overlay.
enableGestures()

Begin gesture processing of touch inputs on the stream container. This is on by default.

- Swipe: move mouse without clicking. - Tap: left click. - Tap then swipe: left click and drag. - Long press: right click. - Two-finger vertical swipe: scroll mouse wheel.

enableVideoStatsOverlay()Enable the video statistics overlay.
getReport()

Get a JSON-friendly report describing the events that occurred during this stream's lifetime, including transit throughput, negotiated codecs, and state transitions.

**Warning**: If metrics was not enabled in the options when creating or joining this stream, then the result is undefined.

pause()Pause the stream. It will stop playing audio and freeze on the current picture until play is called again.
play()Resume playing the stream.
requestFullscreen(options)

Ask the browser to fullscreen the Rainway container. The default behavior is to additionally lock the keyboard and mouse pointer, but this can be overridden by providing options.

For example:

requestFullScreen();
requestFullScreen({ lockKeyboard: false, lockPointer: false });

|
| resumeAudio() | |

Some browsers don't allow pages to play audio unless initiated by a user gesture.

This function tries to resume stream audio. You may call it in response to a suitable user gesture (e.g. body onclick). There is automatically an onclick handler like this on the stream container element.

|
| sendInput(input) | | Send a simulated input event (keyboard, gamepad, etc) to the remote stream, as though the user had performed such an input. |