stackoverflow 69450460
HTML
<video id="v" src="" controls type="video/webm"></video>
<p>
dont forget to pause video before clicking jump
</p>
<button id="b">
JUMP
</button>
CSS
#b {
display: block;
padding: 0.4rem 0.3rem;
background: #ff0a0a;
width: 10rem;
margin: 0.3rem auto;
color: white;
}
#v {
max-width: 34rem;
}
JavaScript
const video = document.getElementById("v");
const button = document.getElementById("b");
video.src = "https://upload.wikimedia.org/wikipedia/commons/transcoded/a/ae/Targeting-Cx43-and-N-Cadherin-Which-Are-Abnormally-Upregulated-in-Venous-Leg-Ulcers-Influences-pone.0037374.s009.ogv/Targeting-Cx43-and-N-Cadherin-Which-Are-Abnormally-Upregulated-in-Venous-Leg-Ulcers-Influences-pone.0037374.s009.ogv.360p.vp9.webm";
button.addEventListener('click', () => {
video.currentTime = video.duration //- 0.0001
//video.play()
console.log("jumped to", video.currentTime)
})
video.addEventListener('ended', (e) => {
// this callback won't be called on chrome if you click "JUMP"
console.log(e.target.ended ? "yay! ended" : "not ended")
//console.log(e.target.currentTime)
})