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

167
Views
En videojs, puedo agregar un controlador de eventos de pista de texto, pero no puedo eliminarlo

Agregué un controlador para el evento 'cuechange' a una pista de texto. Esto funciona bien. Pero no puedo encontrar una manera de eliminar este controlador. Intenté cada una de las instrucciones a continuación para eliminar el controlador, pero todavía se llama.

 onHiliteSpeech() { const textTrack = this.videojsComponent.getTextTrack(); const handleCueChange = () => { ... console.log(in event handler); } }; if (this.bevents) { textTrack.addEventListener('cuechange', handleCueChange); } else { // none of the below instructions remove the handler. textTrack.removeEventListener('cuechange', handleCueChange); // textTrack.removeAllListeners(); // textTrack.removeAllListeners('cuechange'); // textTrack.eventListeners = null; } }

En mi videojsComponent:

 getTextTrack(): TextTrack { return this.player.textTracks()[0]; }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Después de algunas pruebas y errores, encontré el problema. La función "handleCueChange" no debe ser una función anidada dentro de onHiliteSpeech.

Moví handleCueChange fuera de onHiliteSpeech. (Esto también involucró algo de trabajo para permitir que handleCueChange accediera a algunas propiedades de OnHiliteSpeech). El nuevo código de trabajo se convirtió en:

 const handleCueChange = () => { ... console.log(in event handler); } }; onHiliteSpeech() { textTrack.addEventListener('cuechange', this.handleCueChange); ... textTrack.removeEventListener('cuechange', this.handleCueChange); }
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!