Soy un video quiz interactivo recientemente desarrollado, estoy trabajando en un quiz interactivo. Pero me enfrentaré a un problema, haga clic en saltar la ventana de preguntas no cerrada. El evento timeupdate pasa segundos varias veces cómo obtener una vez pasa segundos. Por favor, ayúdame.
getVideoPlayingOnTime(event) { if (this.isVideoQuizFound) { var curTimeTrack = 0; const timeInMiliseconds = event.target.currentTime; const vidDuration = event.target.duration; var sec_num = parseInt(timeInMiliseconds, 10); var hours = Math.floor(sec_num / 3600); var minutes = Math.floor((sec_num - hours * 3600) / 60); var seconds = sec_num - hours * 3600 - minutes * 60; var x = hours < 10 ? "0" + hours : hours; var y = minutes < 10 ? "0" + minutes : minutes; var z = seconds < 10 ? "0" + seconds : seconds; var getHours = x + ":" + y + ":" + z; var a = getHours.split(":"); var getSeconds = +a[0] * 60 * 60 + +a[1] * 60 + +a[2]; var getAtSeconds = seconds * 60; const timeQuiz = this.interactiveVideoQuiz.map((el) => { return el; }); const timeArray = this.interactiveVideoQuiz.map((e)=>{ return e.quiz_time; }) // if (timeArray.indexOf(getAtSeconds)!== -1) { // console.log('yes the value exists!'); // }else{ // console.log("No, the value is absent."); // } timeQuiz.some((x) => { if (parseInt(x.quiz_time) === getAtSeconds) { this.videoStream.nativeElement.pause(); this.videoQuizId = x.quiz_id; this.getVideoQuizz = x.questions; this.pager.count = this.getVideoQuizz.length; this.activeQuiz = "block"; this.videoQuizRequired = x.is_required; } }); } }