Skip to content

Media Stream

Updated

Plays a live stream through this entity’s sound or video, in place of its file.

Type
comp-media-stream
Script class
MediaStreamComponent
Per entity
One
Version
1.0.0

Read about it in Video and streams: what it does, how to use it from a script, and examples.

Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.

  • MediaStream::connected
  • MediaStream::disconnected

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(MediaStreamComponent);
if (component) log(component.props);
}