How to track playback time via the API


If you need to record the playback progress on your side, you can track the playback time via theĀ JS API. Just enable event tracking in the player settings and catch the time event

function PlayerjsEvents(event,id,data){
   if(x == "time"){
      let duration = player.api("duration");
      let time = data;
      if(duration > 0){
         if(time / duration > 0.5){
            // 50%
         }
      }
   }
}



2020 © PlayerJS

Login

Restore password
Sign up
Log in

Sign up free

Sign up
By signing up, you agree to Terms of Service
Login if you have an account

Enterprise

Your name
Website
Email
Phone
Description
Order player

Restore password

Restore
Forgot email? Contact us