Tour

Tour

The Video Tour class

Constructor

new Tour(micrionon-null, datanon-null, markeropt, nullable)

Create a Tour instance
Parameters:
Name Type Attributes Default Description
micrio Micrio The Micrio instance
data VideoTourData The JSON tour data
marker Marker <optional>
<nullable>
null Optional Marker this tour is part of

Classes

Tour

Members

(constant, non-null) data :VideoTourData

The JSON tour data
Type:
  • VideoTourData

duration :number

Tour duration
Type:
  • number

(constant) id :string

The tour id
Type:
  • string

(constant, non-null) onchange :Array.<function(?)>

On state change array of functions
Type:
  • Array.<function(?)>

(constant, non-null) onstart :Array.<function()>

Onstart array of functions
Type:
  • Array.<function()>

(constant, non-null) onstop :Array.<function()>

Onstop array of functions
Type:
  • Array.<function()>

playing :boolean

Playing state
Type:
  • boolean

(constant) stop :function

Bound stop function
Type:
  • function

Methods

addEventListener(type, action, bubblesopt)

Add a media event listener
Parameters:
Name Type Attributes Default Description
type string The event type
action function The event action
bubbles boolean <optional>
false Put on top of stack

getProgress() → {number}

Get the current progress in percentage
Returns:
The current progress in percentage
Type
number

pause(canNavigateopt)

Pause the tour
Parameters:
Name Type Attributes Default Description
canNavigate boolean <optional>
false User can navigate when paused

play()

Play/resume the tour

playPause(canNavigateopt, startAtopt) → (non-null) {Promise}

Play/pause toggle
Parameters:
Name Type Attributes Default Description
canNavigate boolean <optional>
false User can navigate when paused
startAt number <optional>
Continue from this time point
Returns:
Promise when it's paused/playing again
Type
Promise

removeEventListener(type, action, bubblesopt)

Remove a media event listener
Parameters:
Name Type Attributes Default Description
type string The event type
action function The event action
bubbles boolean <optional>
false Put on top of stack

(async) setProgress(perc, sendTickopt)

Set the tour to this progress percentage
Parameters:
Name Type Attributes Default Description
perc number Skip to this percentage of the tour
sendTick boolean <optional>
false Also send an immediate tick event

(async) start(__audioopt, nullable, startAtopt) → (non-null) {Promise.<(boolean|string)>}

Start the tour
Parameters:
Name Type Attributes Description
__audio HTMLAudioElement <optional>
<nullable>
An HTMLAudioElement used for the audio
startAt number <optional>
Start at this progress percentage
Returns:
Returns playing state when the tour has initialized but audio autoplay is blocked, or started
Type
Promise.<(boolean|string)>

stop(eopt, nullable, switchingopt)

Stop this tour
Parameters:
Name Type Attributes Default Description
e VirtualEventData <optional>
<nullable>
Optional event
switching boolean <optional>
false Micrio is switching to another image, don't rehook events