Correction of the displayed time

  Désolé, cet article est disponible en anglais

Hi! I have a task to build a custom video player. Here’s the idea: There’s a 40-minute video, but the player should show it as 30 minutes long. The video itself plays at normal speed, but the time counter (minutes/seconds) should run slower — meaning one “second” on the timer lasts a bit longer than a real second. Essentially, the video runs as usual, but the displayed time moves at a different pace.

We added a factor variable to adjust the display time in the player.

let player = new Playerjs({id:"player",file:"video.mp4",factor:0.75});

A value of 0.5 will display an hour's worth of content as half an hour. To turn 40 minutes into 30, the ratio would be 0.75 (30/40). This also works the other way around.


21.0.0
2025 © PlayerJS

S'inscrire gratuitement

S'inscrire
En vous inscrivant, vous acceptez les Termes de service
Login si vous avez un compte.

Restaurer le mot de passe

Restaurer
Vous avez oublié votre adresse électronique ? Contactez-nous