JSFiddle - React, Tailwind, and code Playground

HTML

<video width="320" height="240" controls autoplay class="header-video">
  <source src="http://www.w3schools.com/html/movie.ogg" type="video/ogg">
  <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4">
</video>

JavaScript

$(document).ready(function(){

    $( '.header-video' ).on(
        'timeupdate', 
        function(event){
            
            // Save object in case you want to manipulate it more without calling the DOM
            $this = $(this);
            
            if( this.currentTime > ( this.duration - 3 ) ) {
                $this.fadeOut(200);
            }

        });

});