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:
<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:
<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:
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:
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
| Property | Required | Description |
|---|---|---|
eventId | Yes | The Sprii event UID to open. |
productId | No | Product id to focus inside the player. The product must be known by Sprii for the event. |
startAtSeconds | No | Playback start time in seconds. |
startMinimized | No | Opens the player in compact mode when supported. |
readAbout | No | Opens the show's read-more/about view instead of normal playback. |
Direct URL links
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:
https://shop.example.com/live?sprii_event=EVENT_UIDYou can also link to a product or timestamp:
https://shop.example.com/live?sprii_event=EVENT_UID&sprii_product=PRODUCT_ID&startAt=120Supported query parameters:
| Query parameter | Description |
|---|---|
sprii_event | Event UID to open. |
sprii_product | Product id to focus inside the player. |
startAt | Playback start time in seconds. |
sprii-start-minimized | Opens the player minimized when present. |
Notes
- Make sure the Sprii widget script is loaded on the page before calling
window.Sprii.openShow().
