Class: AppStreamer#
AppStreamer is the main module export that can be used to connect to, pause, un-pause, and terminate a streaming Omniverse Kit application session. This module may also be used to send/receive custom messages to/from the streaming kit application.
Preferred usage is to construct an instance and call lifecycle methods on it:
const stream = new AppStreamer();
await stream.connect(props);
await stream.sendMessage(msg);
await stream.terminate();
The legacy static API (AppStreamer.connect(...), AppStreamer.terminate(), and so on) is
preserved for backward compatibility and forwards to the most recently constructed instance, but
each call logs a deprecation warning and is subject to cross-instance races when more
than one stream is active. Migrate to the instance API.
Constructors#
new AppStreamer()#
new AppStreamer():
AppStreamer
Returns#
Accessors#
allowDynamicResize#
getallowDynamicResize():boolean
Whether Kit has confirmed support for dynamic resizing during the config handshake.
true only once Kit has advertised support; false otherwise —
including before Kit’s config response has arrived, when Kit explicitly
does not support it, and for GFN streams (which have no such handshake).
Consumers can read this to decide whether to call resize or enable
setFitStreamResolution.
Returns#
boolean
True iff Kit has confirmed dynamic-resize support.
streamStatus#
getstreamStatus():StreamStatus
Gets the current status of the stream.
Returns#
The current status of the stream.
allowDynamicResize#
getstaticallowDynamicResize():boolean
Deprecated#
Read allowDynamicResize on the AppStreamer instance you constructed.
Returns#
boolean
streamStatus#
getstaticstreamStatus():StreamStatus
Deprecated#
Read streamStatus on the AppStreamer instance you constructed.
Returns#
Methods#
connect()#
connect(
props):Promise<StreamEvent>
Connects to the streaming kit app specified by the input props.
Calling connect() repeatedly on the same instance is supported: the underlying DirectStreamer re-attaches the new callbacks to the live RagnarokApp and returns SUCCESS without tearing the stream down. This is the path React StrictMode mount/unmount/remount sequences rely on.
Parameters#
• props: StreamProps
The StreamProps that contain the initialization data for the stream.
Returns#
Promise<StreamEvent>
getChildren()#
getChildren(
primPath,filters):Promise<StageGetChildrenEvent>
Send a request to get the children of a prim.
Parameters#
• primPath: string
Path of the prim used to return the children of the prim.
• filters: string[] = []
Array of USD prim types to filter for children of the prim.
Returns#
Promise<StageGetChildrenEvent>
getStageLoadingState()#
getStageLoadingState():
Promise<StageLoadingStateEvent>
Send a request to retrieve the current loading state of the Kit app.
Returns#
Promise<StageLoadingStateEvent>
makePrimsSelectable()#
makePrimsSelectable(
paths):Promise<StreamEvent>
Send a request to make prims selectable.
Parameters#
• paths: string[]
Array of USD prim paths to make selectable.
Returns#
Promise<StreamEvent>
openStage()#
openStage(
url):Promise<StageOpenEvent>
Send a request to open a stage in Kit.
Parameters#
• url: string
Returns#
Promise<StageOpenEvent>
resetStage()#
resetStage(
deselectPrims):Promise<StreamEvent>
Send a request to reset a stage in Kit.
Parameters#
• deselectPrims: boolean = true
Specify whether or not to deselect prims.
Returns#
Promise<StreamEvent>
resize()#
resize(
width,height):Promise<StreamEvent>
Make a request to update the resolution of the streaming application.
If the requested size is larger than the maximum size (the size specified in the stream config) the stream resolution will not be updated and promise rejection will be thrown.
If fitStreamResolution is set to true, the stream resolution will not be updated and promise rejection will be thrown.
Parameters#
• width: number
The requested width. MaxValue 4096.
• height: number
The requested height. MaxValue 4096.
Returns#
Promise<StreamEvent>
sendMessage()#
sendMessage(
message):Promise<StreamEvent>
Sends the provided custom message to the streaming Kit application.
Parameters#
• message: ApplicationMessage
A custom message to send to the streaming application.
Returns#
Promise<StreamEvent>
setFitStreamResolution()#
setFitStreamResolution(
fitStreamResolution):void
Sets the fit stream resolution flag.
If fitStreamResolution is true, the stream resolution will be updated
to fit the video element current size and stream resolution will be
automatically updated to fit any subsequent changes to the video
element size.
If fitStreamResolution is false, the stream resolution will be set to the
initial width and height specified in the stream config.
Parameters#
• fitStreamResolution: boolean
Whether to fit the stream resolution to the video element.
Returns#
void
setSelectedPrims()#
setSelectedPrims(
paths):Promise<StreamEvent>
Send a request to select a list of prims from a stage in Kit.
Parameters#
• paths: string[]
Array of USD prim paths that can be selected.
Returns#
Promise<StreamEvent>
start()#
start():
Promise<StreamEvent>
Starts/restarts the stream.
Returns#
Promise<StreamEvent>
stop()#
stop():
Promise<StreamEvent>
Stops (pauses) the stream.
Returns#
Promise<StreamEvent>
terminate()#
terminate(
terminateApp):Promise<StreamEvent>
Terminates the stream. The stream reference will be reset and will no longer be accessible. Setup will need to be called to connect to a new session.
If terminateApp is true, then the Kit app instance will also be terminated.
This currently only applies to OVC v1 stream API and NVCF.
Parameters#
• terminateApp: boolean = false
Whether or not to terminate the Kit app instance.
Returns#
Promise<StreamEvent>
~~connect()~~#
staticconnect(props):Promise<StreamEvent>
Parameters#
• props: StreamProps
Returns#
Promise<StreamEvent>
Deprecated#
Construct an AppStreamer (new AppStreamer()) and call connect() on it.
~~getChildren()~~#
staticgetChildren(primPath,filters):Promise<StageGetChildrenEvent>
Parameters#
• primPath: string
• filters: string[] = []
Returns#
Promise<StageGetChildrenEvent>
Deprecated#
Call getChildren() on the AppStreamer instance you constructed.
~~getStageLoadingState()~~#
staticgetStageLoadingState():Promise<StageLoadingStateEvent>
Returns#
Promise<StageLoadingStateEvent>
Deprecated#
Call getStageLoadingState() on the AppStreamer instance you constructed.
~~makePrimsSelectable()~~#
staticmakePrimsSelectable(paths):Promise<StreamEvent>
Parameters#
• paths: string[]
Returns#
Promise<StreamEvent>
Deprecated#
Call makePrimsSelectable() on the AppStreamer instance you constructed.
~~openStage()~~#
staticopenStage(url):Promise<StageOpenEvent>
Parameters#
• url: string
Returns#
Promise<StageOpenEvent>
Deprecated#
Call openStage() on the AppStreamer instance you constructed.
resetDeprecationWarnings()#
staticresetDeprecationWarnings():void
Test-only seam to reset the once-per-process deprecation warning gate. Not part of the public lifecycle API.
Returns#
void
~~resetStage()~~#
staticresetStage(deselectPrims):Promise<StreamEvent>
Parameters#
• deselectPrims: boolean = true
Returns#
Promise<StreamEvent>
Deprecated#
Call resetStage() on the AppStreamer instance you constructed.
~~resize()~~#
staticresize(width,height):Promise<StreamEvent>
Parameters#
• width: number
• height: number
Returns#
Promise<StreamEvent>
Deprecated#
Call resize() on the AppStreamer instance you constructed.
~~sendMessage()~~#
staticsendMessage(message):Promise<StreamEvent>
Parameters#
• message: ApplicationMessage
Returns#
Promise<StreamEvent>
Deprecated#
Call sendMessage() on the AppStreamer instance you constructed.
~~setFitStreamResolution()~~#
staticsetFitStreamResolution(fitStreamResolution):void
Parameters#
• fitStreamResolution: boolean
Returns#
void
Deprecated#
Call setFitStreamResolution() on the AppStreamer instance you constructed.
~~setSelectedPrims()~~#
staticsetSelectedPrims(paths):Promise<StreamEvent>
Parameters#
• paths: string[]
Returns#
Promise<StreamEvent>
Deprecated#
Call setSelectedPrims() on the AppStreamer instance you constructed.
~~start()~~#
staticstart():Promise<StreamEvent>
Returns#
Promise<StreamEvent>
Deprecated#
Call start() on the AppStreamer instance you constructed.
~~stop()~~#
staticstop():Promise<StreamEvent>
Returns#
Promise<StreamEvent>
Deprecated#
Call stop() on the AppStreamer instance you constructed.
~~terminate()~~#
staticterminate(terminateApp):Promise<StreamEvent>
Parameters#
• terminateApp: boolean = false
Returns#
Promise<StreamEvent>
Deprecated#
Call terminate() on the AppStreamer instance you constructed.