When enabled the stream will start when the user clicks on the object this component is attached to
It is also possible to start the stream manually from your code by calling the share method
To modify what type of device is shared you can set the device property.
true
When enabled the stream will start when this component becomes active (enabled in the scene)
Which streaming device type should be used when starting to share (if share is called without a device option). Options are Screen, Camera, Microphone.
This is e.g. used if allowStartOnClick
is enabled and the user clicks on the object.
Screen
Optional
deviceFilter which device should be chosen for sharing by id or label.
Assign a method to this property to manually filter the available devices.
Optional
deviceIf assigned the device the device will be selected by this id or label when starting to share.
Note: This is only supported for Camera
devices
the object this component is attached to. Note that this is a threejs Object3D with some additional features
the unique identifier for this component
Optional
sourceholds the source identifier this object was created with/from (e.g. if it was part of a glTF file the sourceId holds the url to the glTF)
true if the object is enabled and active in the hierarchy
the current stream that is being shared or received
true if this component was destroyed (this.destroy()
) or the whole object this component was part of
true if the component is currently receiving a stream
true if the component is currently sending a stream
the layer of the gameObject this component is attached to
the name of the gameObject this component is attached to
shorthand for this.context.scene
the scene of the context
When enabled the video will be displayed in the screenspace of the VideoPlayer component.
Is the gameObject marked as static
the tag of the gameObject this component is attached to
If a VideoPlayer component is assigned to this property the video will be displayed on the VideoPlayer component.
Optional
init: Partial<NoInternalNeedleEngineState<FilterStartingWith<FilterTypes<ScreenCapture, Function>, "_">>>Optional
earlyOptional
lateOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onCallback when this component joins a xr session (or becomes active in a running XR session)
Optional
onCallback when this component exists a xr session (or when it becomes inactive in a running XR session)
Optional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onCallback when a xr session updates (while it is still active in XR session)
Optional
onOptional
onXRControllerCallback when a controller is connected/added while in a XR session
OR when the component joins a running XR session that has already connected controllers
OR when the component becomes active during a running XR session that has already connected controllers
Optional
onXRControllerOptional
resolveOptional
startstarts a coroutine (javascript generator function)yield
will wait for the next frame:
yield WaitForSeconds(1)
to wait for 1 second.yield WaitForFrames(10)
to wait for 10 frames.yield new Promise(...)
to wait for a promise to resolve.generator function to start
event to register the coroutine for (default: FrameEvent.Update). Note that all coroutine FrameEvent callbacks are invoked after the matching regular component callbacks. For example FrameEvent.Update
will be called after regular component update()
methods)
the generator function (use it to stop the coroutine with stopCoroutine
)
onEnable() { this.startCoroutine(this.myCoroutine()); }
private *myCoroutine() {
while(this.activeAndEnabled) {
console.log("Hello World", this.context.time.frame);
// wait for 5 frames
for(let i = 0; i < 5; i++) yield;
}
}
Stop a coroutine that was previously started with startCoroutine
the routine to be stopped
the frame event to unregister the routine from (default: FrameEvent.Update)
Optional
supportsXROptional callback, you can implement this to only get callbacks for VR or AR sessions if necessary.
true if the mode is supported (if false the mode is not supported by this component and it will not receive XR callbacks for this mode)
Optional
updateGenerated using TypeDoc
The ScreenCapture component allows you to share your screen, camera or microphone with other users in the networked room.
When the stream is active the video will be displayed on the VideoPlayer component attached to the same GameObject.
Note: For debugging append
?debugscreensharing
to the URL to see more information in the console.By default the component will start sharing the screen when the user clicks on the object this component is attached to. You can set device This behaviour can be disabled by setting
allowStartOnClick
to false.It is also possible to start the stream manually from your code by calling the share method.