Autoplay
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.
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:
- The next upcoming show that is scheduled between T - 1 hour and T + 3 hours — with T being the current time.
- 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.
- If neither 1. or 2. apply, the next upcoming show is selected.
- If no upcoming show is available, the most recent show not matching Rule 2. is selected.
- If none of the above rules apply, LiSA Library will not launch any show automatically.
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.
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.