Skip to content

UI Video

Updated

A video element.

Type
comp-ui-video
Script class
UIVideoComponent
Per entity
One
Version
1.2.1

Read about it in Content: 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
borderRadius
borderRadius[] 0 ≤ x ≤ 16384
borderWidth
borderWidth[] 0 ≤ x ≤ 16384
height 0 ≤ x ≤ 16384
margin
margin[] -16384 ≤ x ≤ 16384
padding
padding[] 0 ≤ x ≤ 16384
playbackRate 0.5 ≤ x ≤ 4
volume 0 ≤ x ≤ 1
width 0 ≤ x ≤ 16384

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

  • UIVideo::ready
  • UIVideo::error
  • UIVideo::play
  • UIVideo::pause
  • UIVideo::stop
  • UIVideo::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(UIVideoComponent);
if (component) log(component.props);
}