player.html
player.html copied to clipboard
Feature request - Show remaining time in player
Hi,
i would like to fully switch from video-js to player.html but i have one problem. I would use a script that sort of works like a caption tool which (based on timing) shows certain things. All my data with the timecodes are structured that i have to rely on the elapsed time of the video.
In videojs i can get this info via my script via class="vjs-remaining-time-display" in player.html unfortunately only the elapsed time is shown. Anyway you can help me to get these numbers or add a setting that the user can choose what he wants to see?
Best regards!
If you want to see the time remaining via a script you can access the video player directly:
const $player = document.querySelector('.player');
const remaining = $player.duration - $player.currentTime;
console.log(remaining);
player.html
does support loading captions/subtitles for videos if you have your captions in .srt or .vtt files.