Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
¿Cómo puedo hacer que este video se desplace sin problemas?

El video tiene un intervalo de fotogramas clave alto (establecido en 1), por lo que la búsqueda no es un problema. Se desplaza sin problemas en mi host local, sin embargo, está retrasado en la producción. Aquí hay una demostración . Cualquier ayuda sería muy apreciada ya que he estado atascado en esto por un tiempo.

Mi objetivo es hacer que el video se desplace sin problemas y sin demoras. Estoy usando una solicitud de búsqueda para poder descargar el video completo primero para ayudar con la fluidez, sin embargo, no parece funcionar. Aquí está mi código:

 $(document).ready(function () { var vid = $('#v0'); var url = "videos/video.mp4"; var intro = $("#intro"); var spinner = $(".spinner-border").closest("div"); var checkOnce = false; var videoLength = $('.heading').length * 2; vid.hide(); spinner.hide(); var xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.responseType = "arraybuffer"; xhr.onload = function (oEvent) { var blob = new Blob([oEvent.target.response], { type: "video/mp4" }); vid.src = URL.createObjectURL(blob); vid[0].play(); // required to remove the fixed height intro.css('marginBottom', vid.height()); // refresh video frames on interval for smoother playback setInterval(function () { vid[0].pause(); vid[0].currentTime = (window.pageYOffset / (intro.height() / videoLength)); // change video position to fixed or relative when scrolling past container if ($(window).scrollTop() >= intro.offset().top + intro.outerHeight() - window.innerHeight + vid.height()) { if (checkOnce == false) { vid.css('position', 'relative'); intro.css('marginBottom', 0); checkOnce = true; } } else { if (checkOnce == true) { intro.css('marginBottom', vid.height()); vid.css('position', 'fixed'); checkOnce = false; } } }, 40); }; xhr.onprogress = function (oEvent) { if (oEvent.lengthComputable) { var progress = oEvent.loaded / oEvent.total; if (progress < 1) { spinner.show(); vid.fadeOut(); } else { spinner.hide(); vid.fadeIn(); } } } xhr.send(); });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!