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
Property | Modifiers | Type | Description |
---|---|---|---|
container | readonly | HTMLDivElement | A DOM node containing the stream. Attach this anywhere on your page to display this stream. |
ended | readonly | boolean | Indicates that this stream has ended, and the RainwayStream object should be discarded. |
id | number | A number identifying this stream among the host's streams. | |
peer | Peer | The Peer hosting this stream. | |
permissions | readonly | InputLevel | A bitmask indicating the granted level of interactive control available over the remote stream. |
streamFit | readonly | StreamFit | The current setting for how the stream container fits isolated apps. - - |
Methods
Method | Modifiers | Description |
---|---|---|
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 | |
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. |