Skip to main content

autoplay

Typeboolean | AutoplayOptions
Defaulttrue

Enable Y-axis rotation autoplay.
If true is given, it will enable autoplay with the default options.
You can also customize the autoplay with the following properties.

NameTypeDefaultDescription
delaynumber2000Reactivation delay after mouse input in milisecond
delayOnMouseLeavenumber0Reactivation delay after mouse leave
speednumber1Y-axis(yaw) rotation speed
pauseOnHoverbooleanfalseWhether to pause rotation on mouse hover
canInterruptbooleantrueWhether user can interrupt the rotation with click/wheel input
disableOnInterruptbooleanfalseWhether to disable autoplay on user interrupt

Example

autoplay: true (default)

{
src: "/egjs-view3d/model/draco/alarm.glb",
autoplay: true
}

delay: 5000

{
src: "/egjs-view3d/model/draco/alarm.glb",
autoplay: {
delay: 5000
}
}

pauseOnHover: true & delayOnMouseLeave: 2000

{
src: "/egjs-view3d/model/draco/alarm.glb",
autoplay: {
delayOnMouseLeave: 2000,
pauseOnHover: true
}
}

speed: -5 & canInterrupt: false

{
src: "/egjs-view3d/model/draco/alarm.glb",
autoplay: {
speed: -5,
canInterrupt: false
}
}

disableOnInterrupt: true

{
src: "/egjs-view3d/model/draco/alarm.glb",
autoplay: {
disableOnInterrupt: true
}
}