Class: Player

MetarealPlayerSDK.Player

A Metareal Tour Player.


Members

(static) tour :MetarealPlayerSDK.Tour

The tour that is currently loaded in the player.

(static) user :MetarealPlayerSDK.User

The current user.

Methods

(static) getCurrentBlendingFactor()

gets the current blending factor.


(static) getCurrentComparisonMode()

gets the current comparison mode.


(static) getCurrentSideBySideSeparator()

gets the current side by side separator.


(static) getCurrentVariants()

gets the current primary and secondary variant ids, names and descriptions.


(static) getLookAtPosition(cb)

Gets the 3D coordinates of where the user is looking at.
Parameters:
Name Type Description
cb function The function to call when the position has been calculated.
The function has the following signature:
function( data )
where data is the position


(static) hide(element)

Hide the element.
Parameters:
Name Type Description
element string Can be FULLSCREEN or VR


(static) hideLabel(labelID)

hides the Label by ID.
Parameters:
Name Type Description
labelID string The ID of the label to hide


(static) load(url, cb)

Loads the tour specified by url, and calls cb upon completion.
Parameters:
Name Type Description
url string The URL of the tour to load.
cb function The function to call when the tour is loaded.


(static) moveToPanorama(panorama, transition)

Moves the user to a panorama location.
Parameters:
Name Type Description
panorama string The ID of the panorama to move to.
transition string The type of transition to use for the movement. Can be travelteleport


(static) moveToRoomViewPoint(roomViewPoint)

Switches room view points.
Parameters:
Name Type Description
roomViewPoint string The ID of the view point to move to.


(static) refreshObject(cb)

Refresh an object returned by the data model.
Parameters:
Name Type Description
cb function The function to call once the object data is refreshed.


(static) setCurrentBlendingFactor(factor)

sets the current blending factor.
Parameters:
Name Type Description
factor float The Blending Factor can be between 0.0 and 1.0


(static) setCurrentComparisonMode(mode)

sets the current comparison mode.
Parameters:
Name Type Description
mode string The Comparison Mode can be BLEND or SIDE-BY-SIDE


(static) setCurrentSideBySideSeparator(position)

sets the current side by side separator.
Parameters:
Name Type Description
position float The position of the separator between 0.0 and 1.0


(static) setCurrentVariant(primaryID, secondaryID)

sets the current primary and secondary variant.
Parameters:
Name Type Description
primaryID string The ID of the primary variant
secondaryID string The ID of the secondary variant


(static) setEventListener(eventType, cb)

Sets a listener for a tour player event.
Parameters:
Name Type Description
eventType string The event to listen to. Supported events are startmove, look, moving, endmove, labelclicked, label2clicked, label2linkclicked, label2opened, label2closed, modelviewvlick, modelviewdoubleclick, modelviewcamerachange, roomviewpointchanged, ready
cb function The function to call when the event is fired.
The function has the following signature:
function( data )
where data is the event data


(static) setModelViewCamera(orbitRotation, lookAt, fov, distance)

Sets the parameters of the model view camera. Setting any of the parameters to null indicates that this parameter is not set. This is used when you just want to set only a subset of the parameters. Unset parameters will use values set at authoring time.
Parameters:
Name Type Description
orbitRotation _vector The orbit Euler rotation of the camera in degrees.
For example: {x: 10, y: 20, z: 30}
lookAt _vector The point of interest of the camera.
For example: {x: 1, y: 2, z: 3}
fov number The field of view of the camera in degrees.
distance number The distance between the camera and the point of interest.


(static) setStartingViewMode(mode)

Sets the starting view mode. This is used to set the view mode before the tour starts playing.
Parameters:
Name Type Description
mode string Can be TOUR or MODEL


(static) setTourViewCamera(rotation, fov)

Sets the parameters of the model view camera. Setting any of the parameters to null indicates that this parameter is not set. This is used when you just want to set only a subset of the parameters. Unset parameters will use values set at authoring time.
Parameters:
Name Type Description
rotation _vector The rotation of the camera in degrees.
For example: {x: 10, y: 20, z: 30}
fov number The field of view of the camera in degrees.


(static) setViewMode(mode)

Sets the view mode. This is used to set the view mode while the tour is playing.
Parameters:
Name Type Description
mode string Can be TOUR, FLOOR PLAN or MODEL


(static) setWelcomeScreen(settings)

Starts the tour's showcase.
Parameters:
Name Type Description
settings _welcomescreensettings The settings object to set for play and welcome screens.


(static) show(element)

Show the element.
Parameters:
Name Type Description
element string Can be FULLSCREEN or VR


(static) showLabel(labelID)

Shows a Label by ID.
Parameters:
Name Type Description
labelID string The ID of the label to show


(static) startShowcase(skipInstructions)

Starts the tour's showcase.
Parameters:
Name Type Description
skipInstructions boolean If set to true, skips the introduction screen.