Skip to content

Open shows directly

Use window.Sprii.openShow() when you want your own website UI to open the Sprii player directly. Typical use cases are:

  • A "Watch live" button in your own header, hero, or campaign page.
  • A product page CTA that opens the show at a specific product.
  • A newsletter or landing-page link that opens a known show when the customer lands on your site.

This API is available from the widget script. It opens the onsite player; it is not an SDK action handler like SOME_CHECKOUT or UPDATE_CART_CONTENTS.

Basic usage

Load the Sprii widget script on the page, then call window.Sprii.openShow() with an object:

html
<button id="watch-show">Watch show</button>

<script>
  document.querySelector('#watch-show').addEventListener('click', () => {
    window.Sprii.openShow({
      eventId: 'EVENT_UID',
    });
  });
</script>

Only the event UID is required. The widget fetches the event and resolves the campaign automatically before opening the player.

Open at a specific product

If the button belongs to a product, pass the product id as productId:

html
<button id="watch-product">Watch this product in the show</button>

<script>
  document.querySelector('#watch-product').addEventListener('click', () => {
    window.Sprii.openShow({
      eventId: 'EVENT_UID',
      productId: 'PRODUCT_ID',
    });
  });
</script>

productId should match the product id known by Sprii for that event. If the product is not part of the show, the player can still open the event, but it may not be able to focus the product.

Open at a specific time

Use startAtSeconds to start playback at a timestamp:

js
window.Sprii.openShow({
  eventId: 'EVENT_UID',
  startAtSeconds: 120,
});

startAtSeconds is zero-based. For example, 120 starts two minutes into the video.

Start minimized

Use startMinimized when the player should open in compact mode:

js
window.Sprii.openShow({
  eventId: 'EVENT_UID',
  startMinimized: true,
});

This is useful for automatic or softer entry points where the customer did not explicitly click a large play button.

Parameter reference

PropertyRequiredDescription
eventIdYesThe Sprii event UID to open.
productIdNoProduct id to focus inside the player. The product must be known by Sprii for the event.
startAtSecondsNoPlayback start time in seconds.
startMinimizedNoOpens the player in compact mode when supported.
readAboutNoOpens the show's read-more/about view instead of normal playback.

For links in emails, banners, or other places where you cannot run JavaScript directly, add Sprii query parameters to the page URL where the widget script is loaded:

text
https://shop.example.com/live?sprii_event=EVENT_UID

You can also link to a product or timestamp:

text
https://shop.example.com/live?sprii_event=EVENT_UID&sprii_product=PRODUCT_ID&startAt=120

Supported query parameters:

Query parameterDescription
sprii_eventEvent UID to open.
sprii_productProduct id to focus inside the player.
startAtPlayback start time in seconds.
sprii-start-minimizedOpens the player minimized when present.

Notes

  • Make sure the Sprii widget script is loaded on the page before calling window.Sprii.openShow().