Skip to content

Video

Updated

A video file or HLS stream on a plane or a 360 sphere.

Type
comp-video
Script class
VideoComponent
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.

The props the runtime declares for this component, with their defaults and accepted ranges.

Prop Default Range
height 0 ≤ x ≤ 10000
volume 0 ≤ x ≤ 1
width 0 ≤ x ≤ 10000

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

  • Video::ready
  • Video::error
  • Video::play
  • Video::pause
  • Video::stop
  • Video::end

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(VideoComponent);
if (component) log(component.props);
}