<!DOCTYPE html>
<html>
<head>
<title>Simple Video Example</title>
<!-- Uncomment the following tag when developing on a local or intranet computer -->
<!-- <meta http-equiv='X-UA-Compatible' content="IE=edge" /> -->
<script>
function playVideo(e) {
var video = document.getElementById('video1'); //video element
// Toggle between play and pause based on the paused property
if (video.paused) {
var input = document.getElementById('videoFile'); //text box
if (input.value) {
// Only load a video file when the text field changes
if (input.value != video.src) {
video.src = input.value;
}
video.play();
e.innerHTML = "Pause";
}
} else {
video.pause();
e.innerHTML = "Play";
}
}
</script>
</head>
<body>
<video id="video1" controls >HTML5 video is not supported
</video><br />
<input id="videoFile" type="file" style="width: 230px;" src="" />
<button onclick="playVideo(this);">Play</button>
</body>
</html>