Resume Playback w/ Cookies

Use cookies to remember where the user left off and resume playback at the same time offset when revisiting the page.

License: All
Player Version:
Author: JW Player | GitHub
This demo includes:
  • on('time')
  • on('ready')
<script type="text/javascript">

var player = jwplayer("player");

    file: '//',
    image: '//',

player.on('time', function(e) {
    $cookie.setItem('resumevideodata', Math.floor(e.position) + ':' + player.getDuration());

player.on('ready', function() {
    var cookieData = $cookie.getItem('resumevideodata');
    if(cookieData) {
        var resumeAt = cookieData.split(':')[0],
            videoDur = cookieData.split(':')[1];
        if(parseInt(resumeAt) < parseInt(videoDur)) {
            logMessage('Resuming at ' + resumeAt); //for demo purposes
        else if(cookieData && !(parseInt(resumeAt) < parseInt(videoDur))) {
            logMessage('Video ended last time! Will skip resume behavior'); //for demo purposes
    else {
        logMessage('No video resume cookie detected. Refresh page.');

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.