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

120
Vistas
Rango y video se enfrentan

Estoy escribiendo un reproductor de video. Como barra de tiempo utilizo un rango. A medida que se reproduce el video, el rango también cambia. Pero quiero cambiarlo de la manera opuesta. Quiero que el rango haga que el video cambie su hora actual. Pero, debido a que se cambian entre sí, no puedo mover un pulgar. Intenté configurar Interval null pero no funcionó. Dame una mano con esto, por favor.

 $(document).ready( function () { $("#PlayerVideo").on("loadedmetadata", function (event) { Video = $("#PlayerVideo")[0]; Duration = Video.duration; hours = Math.floor(Duration / 60 / 60); mins = Math.floor((Duration - hours * 60 * 60) / 60); secs = Math.floor(Duration - mins * 60); $("#durTime").html(hours + ":" + mins + ":" + secs); // display cur time Interval = setInterval( function () { Play(); }, 250 ); }); $("#TimeRange").on("input", function() { $.when().then( function() { Interval = null; } ).then( function () { Video = $("#PlayerVideo")[0]; Video.currentTime = $(this).val()*Duration; console.log("cur time is " + Video.currentTime); CurTime = $(this).val()*Duration; } ).then( function () { Interval = setInterval( function () { Play(); }, 250 ); } ); } ); function Play() { Video = $("#PlayerVideo")[0]; CurTime = Video.currentTime; console.log(CurTime); hours = Math.floor(CurTime / 60 / 60); mins = Math.floor((CurTime - hours * 60 * 60) / 60); secs = Math.floor(CurTime - mins * 60); $("#curTime").html(hours + ":" + mins + ":" + secs); $("#TimeRange").val(CurTime / duration * 100); } });

about 4 years ago · Santiago Gelvez
2 Respuestas
Responde la pregunta

0

Intenta agregar $(this).trigger('change'); justo después de llamar a Play() y eliminar $("#TimeRange").val(CurTime / duration * 100);

about 4 years ago · Santiago Gelvez Denunciar

0

Cambié $(esto) a $("#TimeRange"). Y se agregó la división por 100 al establecer un nuevo valor.

about 4 years ago · Santiago Gelvez Denunciar
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