Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

<!

DOCTYPE html>
<html>
<head>
<title>Playback Video</title>
<style>
video {
width: 640px;
height: 480px;
}
</style>
</head>
<body>
<div>
<label for="url-input">Enter Video URL:</label>
<input type="text" id="url-input"
value="http://example.com/video.h264">
<button onclick="play()">Play</button>
<button onclick="stop()">Stop</button>
<button onclick="forward()">Fast Forward</button>
<button onclick="rewind()">Rewind</button>
<button onclick="doubleSpeed()">2x Speed</button>
<button onclick="quadSpeed()">4x Speed</button>
<button onclick="eightSpeed()">8x Speed</button>
</div>
<video id="video-player"></video>
<script>
var videoPlayer = document.getElementById("video-player");
var urlInput = document.getElementById("url-input");
function play() {
videoPlayer.src = urlInput.value;
videoPlayer.play();
}
function stop() {
videoPlayer.pause();
videoPlayer.currentTime = 0;
}
function forward() {
videoPlayer.currentTime += 5;
}
function rewind() {
videoPlayer.currentTime -= 5;
}
function doubleSpeed() {
videoPlayer.playbackRate = 2;
}
function quadSpeed() {
videoPlayer.playbackRate = 4;
}
function eightSpeed() {
videoPlayer.playbackRate = 8;
}
</script>
</body>
</html>

You might also like