Skip to main content

<video>

Displays a video in the world.

Props

PropTypeDescriptionDefault
srcStringURL or path to a video file in your assets folder. MP4.
widthNumberWidth of the video. See notes for more info. Optional.
heightNumberHeight of the video. See notes for more info. Optional.
colorStringColor of the video canvas while it is loadingwhite
litBooleanWhether the video should be affected by environment lighting.false
opacityNumberOpacity of the video1
doublesidedBooleanWhether video is doublesided.false
loopBooleanWhether this video should loop when it gets to the end.false
autoplayBooleanWhether this video should automatically start playing.false
volumeNumberVolume for video audio1
audioSpatialBooleanWhether audio should be spatial.true
audioDistanceNumberThe distance that spatial audio begins to rolloff.10
audioRolloffNumberThe audio rolloff factor after audioDistance.3
audioConeArrayUsed When spatial is enabled. innerAngle, outerAngle, outerGain.[360,0,0]
audioSourceIdStringWhen set, audio analysers in the world (cross app) can analyse this audio if they know the sourceId
frameWidthNumberThe width of the frame around the video.0
frameDepthNumberThe depth of the frame.0
frameColorNumberThe color of the frame.black
positionArrayPosition of the video[0,0,0]
rotationArrayRotation of the video[0,0,0]
onHoverEnterFunctionCalled when an avatar hovers over the video. Provides an Event
onHoverLeaveFunctionCalled when an avatar hovers out of the video. Provides an Event
onPointerDownFunctionCalled when avatar presses the pointer down over this object.
onPointerDownHintStringText displayed when hovering over this object when onPointerDown is defined.
onPointerUpFunctionCalled when avatar releases the pointer over this object.
onPointerUpHintStringText displayed when hovering over this object with the pointer down and onPointerUp is defined.
hitDistanceNumberMaximum distance to interact with this node.3

Notes

  • If only width is set, height is automatically calculated to maintain aspect ratio
  • If only height is set, width is automatically calculated to maintain aspect ratio
  • If both width and height are set, the video will cover these dimensions, similar to the background-size: cover functionality in CSS.
  • If neither height or width is set, the video will be displayed with a height of 1 and width will be automatically calculated to maintain aspect ratio