Autostart Only Once

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

License: All
Player Version:
Author: JW Player | GitHub
<script type="text/javascript">

var pageReloaded = JSON.parse(localStorage.getItem('jwplayer.page-reloaded'));

var player = jwplayer('player').setup({
  playlist: 'https://cdn.jwplayer.com/v2/media/tkM1zvBq',
  // Do not autostart if the page was reloaded.
  autostart: pageReloaded ? !pageReloaded : true
});

localStorage.setItem('jwplayer.page-reloaded', true);

</script>
Please Note: 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.