<html> | |
<head> | |
<script> | |
function playVideo() | |
{ | |
document.getElementById("test-video").play(); | |
} | |
function pauseVideo() | |
{ | |
document.getElementById("test-video").pause(); | |
} | |
function seekNearTheEnd() | |
{ | |
let video = document.getElementById("test-video"); | |
video.currentTime = video.duration - 0.5; | |
} | |
</script> | |
</head> | |
<body> | |
<p> | |
<video id="test-video" src="test.mp4" controls></video> | |
</p> | |
<p> | |
<button onclick="playVideo()">Play Video</button> | |
</p> | |
</body> | |
</html> |