Skip to content Skip to sidebar Skip to footer

Jw Player Resume After Refresh

how to make the JW Player have a 'resume' or 'remember' function which marks position of last play position of movie and remembers it when you come back to watch video again? So,

Solution 1:

This should get you started:
http://osric.com/chris/jwplayer/jwplayer5.4/ontime.html
The JavaScript from that page is as follows:

$(document).ready( function() {
jwplayer("container").setup({
    file:"playlist.xml",
    height: 300,
    width: 400,
        events: {
        onTime: function(event) {
            $('#timer').html(Math.floor(event.position));
        }
    }
});

That code sets an element with the id of "timer" to be the value of the current position.
You could then create either a cookie to save the variable from the JS.

Edit
You can use this link to help with the cookie function:
http://www.w3schools.com/js/js_cookies.asp

$(document).ready( function() {
    jwplayer("container").setup({
    file:"playlist.xml",
    height: 300,
    width: 400,
        events: {
        onPause: function(event) {
            setCookie(event.position);
        }
    }
});

Post a Comment for "Jw Player Resume After Refresh"