Developer Guide Javascript API Reference Developer Tools Release Notes

Autostart Only Once

A demo setup that autostarts the video - but only for the first time a user visits the page.

const storageKey = '';

let shouldAutostart = true;
const wasReloaded = JSON.parse(localStorage.getItem(storageKey));
if (wasReloaded) {
  shouldAutostart = false;

  playlist: '',
  // Do not autostart if the page was reloaded.
  autostart: shouldAutostart

localStorage.setItem(storageKey, true);

const refreshBtn = document.querySelector('.refresh');
refreshBtn.addEventListener('click', () => window.location.reload());

const clearStorageBtn = document.querySelector('.clear-storage');
clearStorageBtn.addEventListener('click', () => {
This player implementation is a Proof of Concept only provided to show the possibilities of the JW Player and Platform and should not be taken as an offer to create, edit or maintain custom integration or development.