I'm working on a webpage that features multiple videos. I want to capture a specific value from an input field and display it once a video finishes playing. Below is my current setup:
HTML
<input type='text' name='profileUsername' value='<?php echo $username; ?>' hidden>
<video width="320" height="240" id='video' controls>
<source src="videos/<?php echo $row['video'] ?>" type="video/mp4">
Your browser does not support the video tag.
</video>
The above code snippet uses a PHP while Loop.
JS
document.getElementById('video')[0].addEventListener('ended', myHandler, false);
function myHandler(e) {
alert("Hello");
// Perform actions after the event
}