Autoplay
A manager class for autoplay feature.
class Autoplay
Properties
Whether user can interrupt the rotation with click/wheel input
Reactivation delay after mouse input in milisecond.
Reactivation delay after mouse leave when using pauseOnHover
Whether to disable autoplay on user interrupt
Whether autoplay is enabled or not
Whether to pause rotation on mouse hover
Whether autoplay is updating the camera at the moment
Y-axis(yaw) rotation speed
Methods
Destroy the instance and remove all event listeners attached
Disable autoplay and remove all event handlers.
Enable autoplay and add event listeners.
Enable autoplay after current delay
value.
Rotate camera by given deltaTime
Constructor
new Autoplay(viewer: View360, element: HTMLElement, options: boolean | Partial<AutoplayOptions>): Autoplay
Parameters
HTMLElement
Canvas element
boolean | Partial<AutoplayOptions>
Autoplay options
Properties
canInterrupt
canInterruptboolean
true
Whether user can interrupt the rotation with click/wheel input
delay
delaynumber
2000
Reactivation delay after mouse input in milisecond.
delayOnMouseLeave
delayOnMouseLeavenumber
0
Reactivation delay after mouse leave when using pauseOnHover
disableOnInterrupt
disableOnInterruptboolean
false
Whether to disable autoplay on user interrupt
enabled
enabledboolean
Whether autoplay is enabled or not
pauseOnHover
pauseOnHoverboolean
false
Whether to pause rotation on mouse hover
playing
playingboolean
Whether autoplay is updating the camera at the moment
speed
speednumber
1
Y-axis(yaw) rotation speed
Methods
destroy
destroyvoid
destroy(): void
Destroy the instance and remove all event listeners attached
disable
disablevoid
disable(): void
Disable autoplay and remove all event handlers.
enable
enablevoid
enable(): void
Enable autoplay and add event listeners.
enableAfterDelay
enableAfterDelayvoid
enableAfterDelay(): void
Enable autoplay after current delay
value.
update
updatevoid
update(deltaTime: number): void
Rotate camera by given deltaTime
Parameters
number
Number of milisec to update