Animations
rooomProducts Viewer API animation controls for product demonstrations. Play, pause, stop, and manage 3D product animations with timing, looping, and interactive playback options.
getAnimations
getAnimations(callback: Function)
Returns the list of all animations available for the product.
api.getAnimations(function(animations){
console.log(animations); // Result: [{ name: 'door_open', speedRatio: 1 }]
});playAnimation
playAnimation(animationId: number, [callback: Function])
Plays the animation by animationId. Get the animationId from the getAnimations list.
api.playAnimation(0, function(){
console.log('Animation playing');
});pauseAnimation
pauseAnimation(animationId: number, [callback: Function])
Pauses the animation by animationId. Get the animationId from the getAnimations list.
api.pauseAnimation(0, function(){
console.log('Animation paused');
});stopAnimation
stopAnimation(animationId: number, [callback: Function])
Stops the animation by animationId. Get the animationId from the getAnimations list.
api.stopAnimation(0, function(){
console.log('Animation stopped');
});stopAnimations
stopAnimations([callback: Function])
Stops all the animations.
api.stopAnimations(function(){
console.log('All animations stopped');
});setAnimationCycleMode
setAnimationCycleMode(animationId: number, mode: 'loop' | 'once', [callback: Function])
Sets the animation cycle mode. (Default is once). Get the animationId from the getAnimations list.
api.setAnimationCycleMode(0, 'loop', function(){
console.log('Animation cycle mode changed');
});setAnimationSpeed
setAnimationSpeed(speed: number, [callback: Function])
Sets the global animation speed.
speed is a speed factor (a number, default is 1). A negative value will play the animation in reverse.
api.setAnimationSpeed(1.5, function(){
console.log('Animation speed changed');
});