<title>html5 video demo</title>
<script src="popcorn.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
+ <script src="http://google.com/jsapi"></script>
+ <script>google.load("language","1");</script>
<style type="text/css" media="screen">
body {
background-color:#eee;
</head>
<body>
<div id="container">
- <video src="http://a52.video2.blip.tv/7320003802153/Etherworks-WebMadeMovies3BuildingABetterInternet799.ogg" data-timeline-sources="xml/webMadeMovies.xml" controls></video>
+ <video src="../webMadeMovies.ogg" data-timeline-sources="xml/webMadeMovies.xml" controls></video>
+ <select id="language">
+ <option val="en">English</option>
+ <option val="es">Spanish</option>
+ <option val="fr">French</option>
+ <option val="de">German</option>
+ <option val="ja">Japanese</option>
+ <option val="zh">Chinese</option>
+ </select>
<div id="sub"></div><br />
<div id="tagthisvideo">In this video:<span id="inthisvideo"></span></div><br />
<div id="map"></div>
var SubtitleCommand = function(name, params, text) {
VideoCommand.call(this, name, params, text);
this.onIn = function() {
- document.getElementById("sub").innerHTML = this.text;
+ var i = document.getElementById("language").selectedIndex;
+ google.language.translate(this.text, '', document.getElementById("language").options[i].getAttribute("val"), function(result) {
+ document.getElementById("sub").innerHTML = result.translation;
+ });
+
};
this.onOut = function() {
document.getElementById("sub").innerHTML = "";