WP Video Subscriptions
  • General
  • Products
    • VS Netflix Theme
    • WP Video Memberships
  • FAQ
  • Developers
  • Submit A Ticket
  • General
  • Products
    • VS Netflix Theme
    • WP Video Memberships
  • FAQ
  • Developers
  • Submit A Ticket
Developers / Continue Watching for Custom Players

Continue Watching for Custom Players

If you are using a Custom video player, you can hook into the VS Netflix Continue Watching feature using the following setup:

1. Enqueue your custom JS script

Within your functions.php or other script registration file, register a new Javascript / jQuery file.

wp_register_script( 
'your-custom-script-handle',
'/{js-script-directory}',
array('jquery', 'wpvs-user-video-tracking-js'),
{theme-or-plugin-version}, //optional
true // optional
);

*Note: be sure to include the wpvs-user-video-tracking-js within the dependencies array.

2. Add Event Listeners To Your Video Player Object

Within your custom Javascript file, you will need to use your custom video player API or other method for controlling the video player object. This will vary depending on which player you are using:

Time Updated Event

Most video players should provide an event that fires when the time of the player is updated. Add an event listener that fires our update users continue watching function:

wpvs_update_users_current_video_time(current_time, video_length)

Both parameters current_time and video_length are required when calling this function.

The current_time parameter should be the current time of the video.

The video_length parameter should be the total duration of the video.

**We highly recommend using a custom interval in addition to the Time Updated event of your video player in order to prevent multiple requests to your server.

For example, within your Time Updated event, use a custom variable such as 10 (10 seconds) to fire the wpvs_update_users_current_video_time every 10 seconds, rather than every time the Time Updated event fires.

Video Player time updated events may fire as often as every 250ms, which would cause the wpvs_update_users_current_video_time function to fire 4 times a second.

Ended Event

The second event listener you should add to your custom video player script is when the video ends.

When your video player fires an ended event, call the wpvs_update_users_current_video_time function setting both the current_time and video_length parameter to the duration of the video. This zeros the remaining time the current user has on the video, which removes it from their continue watching list.

wpvs_update_users_current_video_time(video_length, video_length)

Reminder: Vimeo, WordPress & YouTube

If you are using our built in Vimeo, WordPress or YouTube video players, the Continue Watching functionality is already built in and will fire automatically.

VS Netflix Theme
Changelog Creating A Full-Width Menu Creating TV Shows & Series Customizing Your Theme Featured Area Sliders Importing Demo Content Turning On Video Reviews VS Netflix Shortcodes Why aren’t my videos displaying on the home page?
WP Video Memberships
Account Page Setup Adding Fields To Account Forms Changelog Free Memberships Hooks & Filters PayPal Payments Setup Restrict Members From WP Admin Stripe Payments Setup WP Video Memberships Shortcodes
General
Activating Your Website Helpful Links Restricting Vimeo Videos To Your Website Only
FAQ
Can’t Login on WordPress.com site Enabling Registration (Registration is disabled) How can I customize the Create Account form? Why aren’t my payment buttons displaying on the checkout page? Why won’t my Gmail work for sending emails?
Developers
Continue Watching for Custom Players Customizing WP Videos Archive Templates REST API Endpoints Restricting REST API Data
Cookie Notice Setup
Quick Links
  • General
  • VS Netflix Theme
  • WP Video Memberships
  • FAQ
Account
  • Login
Support
  • Submit A Ticket

© WP Video Subscriptions 2025