autoplay
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.
Name | Type | Default | Description |
---|---|---|---|
delay | number | 2000 | Reactivation delay after mouse input in milisecond |
delayOnMouseLeave | number | 0 | Reactivation delay after mouse leave |
speed | number | 1 | Y-axis(yaw) rotation speed |
pauseOnHover | boolean | false | Whether to pause rotation on mouse hover |
canInterrupt | boolean | true | Whether user can interrupt the rotation with click/wheel input |
disableOnInterrupt | boolean | false | Whether to disable autoplay on user interrupt |
Example
autoplay: true (default)
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
autoplay: true
}
delay: 5000
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
autoplay: {
delay: 5000
}
}
pauseOnHover: true & delayOnMouseLeave: 2000
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
autoplay: {
delayOnMouseLeave: 2000,
pauseOnHover: true
}
}
speed: -5 & canInterrupt: false
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
autoplay: {
speed: -5,
canInterrupt: false
}
}
disableOnInterrupt: true
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
autoplay: {
disableOnInterrupt: true
}
}