Options
All
  • Public
  • Public/Protected
  • All
Menu

The State.Main constructor is used as HTMLMicrioElement.state, and offers:

  • Reading and setting the active tour and marker
  • Loading and saving the entire current state as a minimal independent JSON object

Hierarchy

  • Main

Index

Properties

Accessors

Methods

Properties

Readonly tour

The current MarkerTour or VideoTour store Writable

Readonly marker

marker: Writable<Marker> = ...

The current shown image's opened Marker store Writable

media

media: { play: any; pause: any; paused: boolean; currentTime: number; duration: number }

Currently playing media controller

Type declaration

  • play:function
    • play(): Promise<void>
    • Play the media

      Returns Promise<void>

  • pause:function
    • pause(): void
    • Pause the media

      Returns void

  • paused: boolean

    Media paused state

  • currentTime: number

    Media current time

  • duration: number

    Media total duration

Accessors

$tour

$marker

Methods

get

  • Gets the current state as an independent, minimal JSON object. This includes the currently open image(s), marker(s), and actively playing media (video, audio, tour) and its state. You can use this object in any other environment to immediately replicate this state (neat!).

    Example:

    // Save the current state in Browser 1
    const state = micrio.state.get();

    // Save or sync this object to Browser 2 and load it there..

    // This makes the <micr-io> session state identical to Browser 1.
    micrio.state.set(state);

    Returns MicrioStateJSON

set

  • Sets the state from a MicrioStateJSON object, output by the function above here. This works on any Micrio instance!

    Parameters

    Returns void

Generated using TypeDoc