Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

220
Vistas
Calculate the video progress bar percentage

Am developing chapters on the video. Based on the provided time (for example)

00:00 - Welcome

01:20 - Introduction

03:20 - The end

I have the html as like below:

<div class="overall-chapter-layer">
<div class="time-layer" width="0%">
<div class="progress-layer"></div>
</div>

Since 3 chapters provided. Now, the progress bars will be rendered based on the given time. In UI level, it will look like three Progress bars. (Just as like Youtube chapters)

Here, While video is playing need to update the progress. Since 3 chapters are provided, need to update the progress bar for each from 0 to 100%.

For the first progress bar am calculating the progress bar percentage as like below:

current_video_time / current_vid_duration * 100

Am missing the logic to calculate the progress bar percentage for remaining chapters. am trying like

(current_video_time - current_vid_duration[i-1])/(current_vid_duration[i] - current_vid_duration[i-1]) )*100;
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda