Relative Content

Tag Archive for javascripthtmlvideo

Button shows sometimes and sometimes not

I’m trying to track watch time of a video with using JavaScript. But the problem is sometimes the script works well and sometimes it doesn’t. I want to show a “Next video” button when the video is 90% watched by user, in ideal scenario the button shows up button sometimes it just doesn’t, How can I fix this issue?

Video play when div has class active and pause when has class next

Div’s with video has 3 other classes – active, prev and next. I want to play video when the div has class “active”. For div’s ‘.item’ querySelectorAll don’t work and querySelector work only on first div ( play movie but don’t pause when the div class change from active to prev or next).