Widgets
...
Content Hub
Configuration options

Autoplay

4min

The optional autoplay option automatically launches a show without a viewer having to actively click a library item. autoplay accepts either a boolean value or a callback function.

Type definition

TypeScript


Automatic show selection

Autoplay


If autoplay is set to true, LiSA Library selects the show to be launched automatically by applying the following checks in their order of priority as listed below:

  1. The next upcoming show that is scheduled between T - 1 hour and T + 3 hours — with T being the current time.
  2. If 1. does not apply to any show, the most recent show that was scheduled T - 48 hours and T is selected — with T being the current time.
  3. If neither 1. or 2. apply, the next upcoming show is selected.
  4. If no upcoming show is available, the most recent show not matching Rule 2. is selected.
  5. If none of the above rules apply, LiSA Library will not launch any show automatically.

Individual show selection

Autoplay callback


You can also provide a callback function to select the desired show, applying custom logic. The callback function accepts an iterable collection of shows and the library instance. It's return value is either the desired show's identifier (id) or undefined, if the desired your requirements do not apply to any of the shows.

Query parameter lisa_autoplay

In addition to launching a show using the autoplay option, LiSA Library also checks your content page URL's query string for the lisa_autoplay parameter.

Example: https://your-storefront.com/live-shopping?lisa_autoplay=a0377e94-0f09-4cb7-a630-f5b2c3df74ed

In this example LiSA Library automatically launches the show with the ID a0377e94-0f09-4cb7-a630-f5b2c3df74ed either in an overlay or an embedded player (stage) — irrelevant of that particular show being listed in the library or not.