:::: MENU ::::

jQuery Plugin – make jwplayer resumable for next visit and improve conversion

jwplayer

In my previous post I wrote jQuery plugin that resume flowplayer from the last played position. In this post I’ll make jwplayer resumable.

Resumable jwplayer

Meaning is neat – when you host long video presentation for your sales information and then slowly show add to cart button and other offers and timer stuff it might possible, your user might get distracted and leave site. But when they come again they again have to see whole presentation from beginning and wait for 20-30 mins for add to cart pops up or exit-splash bother them.

Lets start with minimal setup.

Hide Promotional Content within Div

 Now add necessary scripts:-

jQuery Plugin Code:-

Plugin initialization:-

 Plugin code Explanation:-

  • Once you call init() function with local storage identifier It’ll listen to jwplayer playback and log current playback time as video-identifier value.
  • then resumePlayBack() function will take two arguments
    [1] timeout for hidden content to show.
    [2] target hidden div to show.
  • Once this function is initialize it continuously check for the condition
    if(current_time > aftertime) => it’ll show hidden content

Code that retains hidden div visible if user already watched configured seconds.

Now look at above code, jwplayer API provides onReady() event callback it fires when player is ready for playback. So, we called our resumable jwplayer on its ready event. while onTime() callback will fire on every second of playback so here we check if playback position already passed 10 seconds then show hidden content.


So, what do you think ?

  •