how to pass php value to script variable : i have a php variable value and we have to pass it to a script variable automatically on a button click 


----------

        <button><? echo $part1;?></button><? }?><br>
    
    <video style="border:1px solid" id="myVideo" width="320" height="176" controls>
        <source src="uploads/videos/<?php echo $vid;?>" type="video/mp4">
    </video>
    <script>
          var video = document.getElementById('myVideo');
    
    var videoStartTime = 0;
    var durationTime = 0;
    
    video.addEventListener('loadedmetadata', function() {
      videoStartTime = 2;
      durationTime = 4;
      this.currentTime = videoStartTime;
    }, false);
    
    video.addEventListener('timeupdate', function() {
      if(this.currentTime > videoStartTime + durationTime){
        this.pause();
      }
    });
       </script>

 