It all depends on what kind of menu you want and what type of videos you want to play.
Here's some code for a basic menu playing YouTube videos.
Code:
<!doctype html>
<html>
<head>
<title>Dropdown for videos</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<style>
body {margin: 0; padding: 0}
</style>
<script>
//This script enables execution of javascript in the options of a selectboxe
function load_script_container()
{
var div_node=document.createElement('div');
div_node.setAttribute("id", "script_container");
document.body.appendChild(div_node);
}
function javascript_in_selectbox(which_box) {
var optionValue=document.getElementById(which_box).options[document.getElementById(which_box).selectedIndex].value;
if (optionValue=="none") {}
else {
var script_inside_selectbox_option = document.createElement('script');
script_inside_selectbox_option.type = 'text/javascript';
script_inside_selectbox_option.text = optionValue;
while(document.getElementById("script_container").firstChild)
{document.getElementById("script_container").removeChild(document.getElementById("script_container").firstChild);}
document.getElementById("script_container").appendChild(script_inside_selectbox_option);
}
}
</script>
<body>
<div id="the_videos" style="position: absolute; top: 15%; left: 15%; right:15%; bottom:15%; background: black">
<iframe name="the_videos" style="position: absolute; width: 100%; height: 100%" scrolling="no" frameborder="0"></iframe>
</div>
<div style="position: absolute; top: 20px; width: 100%; text-align: center">
<select name="chopin" id="chopin" onchange="javascript_in_selectbox('chopin'); selectedIndex=0" onfocus="selectedIndex=0" style="width: 70px; font-family: arial; font-size: 12px; " >
<option value="none" selected >Chopin</option>
<option value="frames.the_videos.location='http://www.youtube-nocookie.com/embed/ROVy9PC8_8A?autoplay=1&vq=large'" >--- Etude op. 10/1</option>
<option value="frames.the_videos.location='http://www.youtube-nocookie.com/embed/q2a6VQYSU20?autoplay=1&vq=large&playlist=rjyaBgB39j4'" >--- Fantasy on Polish Airs</option>
<option value="frames.the_videos.location='http://www.youtube-nocookie.com/embed/h2S5Kcb7bzk?autoplay=1&vq=large'" >--- Rondo à la Krakowiak</option>
</select>
<select name="dvorak" id="dvorak" onchange="javascript_in_selectbox('dvorak'); selectedIndex=0" onfocus="selectedIndex=0" style="width: 70px; font-family: arial; font-size: 12px; " >
<option value="none" selected >Dvorak</option>
<option value="frames.the_videos.location='http://www.youtube-nocookie.com/embed/smIB0aC7XCY?autoplay=1&vq=large'" >--- Polak from Czech Suite</option>
<option value="frames.the_videos.location='http://www.youtube-nocookie.com/embed/mDtWw0nbMbM?autoplay=1&vq=large'" >--- Serenade for strings</option>
<option value="frames.the_videos.location='http://www.youtube-nocookie.com/embed/_9RT2nHD6CQ?autoplay=1&start=60&vq=large'" >--- Symphony No. 9</option>
</select>
</div>
<!-- Put this at the end of the body section -->
<script>load_script_container()</script>
</body>
</html>
Bookmarks