I am newly Interactive video quiz developed, I am working Interactive quiz get Question show particular seconds. But I will face one issue, click on skipping question window not closed. The timeupdate event passes seconds multiple time how to get one time pass seconds. Please help me.
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;
}
});
}
}