Please help me with this javascript (html video player)
https://code.sololearn.com/WxW7dX94R8wB/?ref=app Hi guys , above code is such a code that I have a video tag in it When you play video ,I have added the addlistener timeupdate on it,that means every time the current video duration changes a function is called ! Then function that us called does this thing : It checks if the current video duration is greater than the 40% of the total duration then it calls other function saying : console.log("+1 added to total views") But every time if video current duration is great then the 40% of total video duration it called function again again saying +1 added But i want the function to be called only once if the video duration is greater than the 40% of total duration To make it easy 4 u guys to understand It's simple I'm calling a function if the video has been watched or current duration is greater than the 40% of total video duration then it has to called a function that adds +1 to views count But I'm using greater than it calls function multipleTime