<!doctype html>
<html>
<head>
<title>Tag video</title>
<meta charset="utf-8" />
<script language="Javascript">
window.onload = function(){
var b1 = document.getElementById("src1");
var b2 = document.getElementById("src2");
var b3 = document.getElementById("src3");
var b4 = document.getElementById("src4");
b1.addEventListener("click",changeSrc);
b2.addEventListener("click",changeSrc);
b3.addEventListener("click",changeSrc);
b4.addEventListener("click",changeSrc);
}
function changeSrc(event){
console.log(event);
console.log(event.target.value);
var video = document.getElementById("Video1");
video.src = event.target.value;
}
function vidplay1()
{
var video = document.getElementById("Video1");
var button = document.getElementById("play");
if (video.paused)
{
video.play();
button.textContent = "II";
}
else
{
video.pause();
button.textContent = "➤";
}
}
function restart1()
{
var video = document.getElementById("Video1");
video.currentTime = 0;
}
function skip1(value)
{
var video = document.getElementById("Video1");
video.currentTime += value;
}
function expand1()
{
//2do;
}
</script>
</head>
<body>
<table align="center">
<tr>
<td>
<video controls width="502" height="360" id="Video1">
<source src="video1.webm" type=video/webm>
</video>
</td>
</tr>
<tr>
<td align="center">
<div id="PLAYER1">
<button id="restart" onclick="restart1()">↺</button>
<button id="rew" onclick="skip1(-10)">↶</button>
<button id="play" onclick="vidplay1()">➤</button>
<button id="fastFwd" onclick="skip1(10)">↷</button>
<button id="exp" onclick="expand1()">[x]</button>
</div>
</td>
<button id="src1" value = "video1.webm"><img src="video1.png" width="310" height="220" /></button>
<button id="src2" value = "video2.webm"><img src="video2.png" width="310" height="220" /></button>
<button id="src3" value = "video3.webm"><img src="video3.png" width="310" height="220" /></button>
<button id="src4" value = "video4.webm"><img src="video4.png" width="300" height="220" /></button>
</tr>
</table>
</body>
<html>