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

104
Views
Detener el video automáticamente cuando se establece cierto tiempo mecanografiado

Estoy tratando de limitar la reproducción de video dentro del rango de número que especificó el usuario.

El usuario especificó un marco inicial y un marco final como este.

 frameInputEnd: 300 frameInputStart: 50

vuelvo a calcular esas entradas en segundos como este

 this.startDuration = (((1000 / this.fpsCount) * this.rangeFrame.frameInputStart) / 1000).toFixed(2); this.endDuration = ((1000 / this.fpsCount) * this.rangeFrame.frameInputEnd) / 1000;

y establezca currentTime = this.startDuration . De esa manera, el usuario puede hacer que la duración comience en el cuadro que ha especificado. Quiero agregar un evento en el que el video haya alcanzado el frameInputEnd currentTime es lo que hice

 this.videoPlayer.nativeElement.ontimeupdate = (e: any) => { this.whatFps = `${Math.ceil(e.target.currentTime * this.fpsCount)} / ${this.totalFrame}`; if(this.videoPlayer.nativeElement.currentTime.toFixed(2) == Number(this.endDuration).toFixed(2)){ this.pause() } }

agrego .toFixed(2) ya que frameInputEnd es igual a 12.50 segundos. pero el currentTime nunca coincide con 12.50 segundos, ya sea 12.51 o 12.52, el video nunca se detuvo automáticamente.

¿Alguien sabe una forma de bateador para lograr esto?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

intenta usar >= en lugar de ==

about 4 years ago · Juan Pablo Isaza Report
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!