Skip to main content

Autoplay

Since version 4.0.0

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

Create new AutoPlayer instance
new Autoplay(viewer: View360, element: HTMLElement, options: boolean | Partial<AutoplayOptions>): Autoplay

Parameters

viewer
element

HTMLElement

Canvas element

options

boolean | Partial<AutoplayOptions>

Autoplay options

Properties

canInterrupt

>=4.0.0
canInterrupt

boolean

true

Whether user can interrupt the rotation with click/wheel input

delay

>=4.0.0
delay

number

2000

Reactivation delay after mouse input in milisecond.

delayOnMouseLeave

>=4.0.0
delayOnMouseLeave

number

0

Reactivation delay after mouse leave when using pauseOnHover

disableOnInterrupt

>=4.0.0
disableOnInterrupt

boolean

false

Whether to disable autoplay on user interrupt

enabled

>=4.0.0
readonly
enabled

boolean

Whether autoplay is enabled or not

pauseOnHover

>=4.0.0
pauseOnHover

boolean

false

Whether to pause rotation on mouse hover

playing

>=4.0.0
readonly
playing

boolean

Whether autoplay is updating the camera at the moment

speed

>=4.0.0
speed

number

1

Y-axis(yaw) rotation speed

Methods

destroy

>=4.0.0
destroy

void

destroy(): void

Destroy the instance and remove all event listeners attached

disable

>=4.0.0
disable

void

disable(): void

Disable autoplay and remove all event handlers.

enable

>=4.0.0
enable

void

enable(): void

Enable autoplay and add event listeners.

enableAfterDelay

>=4.0.0
enableAfterDelay

void

enableAfterDelay(): void

Enable autoplay after current delay value.

update

>=4.0.0
update

void

update(deltaTime: number): void

Rotate camera by given deltaTime

Parameters

deltaTime

number

Number of milisec to update