From: ScottDowne Date: Wed, 30 Jun 2010 19:50:36 +0000 (-0400) Subject: merged and fixed overlay with new index.html X-Git-Tag: v0.1~60^2~3^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=b7b0b366d59465557ab58ce831559218cd61faf9;p=popcorn-js.git merged and fixed overlay with new index.html --- diff --git a/index.html b/index.html index 0342b01..3d42538 100644 --- a/index.html +++ b/index.html @@ -69,9 +69,8 @@
-
+
-
diff --git a/popcorn.js b/popcorn.js index 87d75a4..9c85d49 100644 --- a/popcorn.js +++ b/popcorn.js @@ -98,8 +98,6 @@ } }; - - //////////////////////////////////////////////////////////////////////////// // Command objects //////////////////////////////////////////////////////////////////////////// @@ -145,8 +143,8 @@ // Creates a div for all overlays to use if (!VideoManager.overlayDiv) { VideoManager.overlayDiv = document.createElement('div'); - VideoManager.overlayDiv.setAttribute('style', 'position:absolute;top:20px;left:20px'); - this.videoManager.videoElement.parentNode.appendChild(VideoManager.overlayDiv); + VideoManager.overlayDiv.setAttribute('style', 'position:absolute;top:1px;left:1px'); + document.getElementById("videoContainer").appendChild(VideoManager.overlayDiv); } // Checks for a url of an image to overlay onto the video @@ -172,15 +170,23 @@ // Child commands. Uses onIn() and onOut() to do time based operations var SubtitleCommand = function(name, params, text, videoManager) { VideoCommand.call(this, name, params, text, videoManager); + + // Creates a div for all subtitles to use + if (!SubtitleCommand.subDiv) { + SubtitleCommand.subDiv = document.createElement('div'); + SubtitleCommand.subDiv.setAttribute('style', + 'position:absolute;top:240px;left:1px;color:white;font-weight:bold;font-family:sans-serif;text-shadow:black 1px 1px 3px;font-size:22px;width:820px;'); + document.getElementById("videoContainer").appendChild(SubtitleCommand.subDiv); + } this.onIn = function() { 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; + SubtitleCommand.subDiv.innerHTML = result.translation; }); }; this.onOut = function() { - document.getElementById("sub").innerHTML = ""; + SubtitleCommand.subDiv.innerHTML = ""; }; }; diff --git a/style.css b/style.css index b04ba45..8b3c412 100644 --- a/style.css +++ b/style.css @@ -237,6 +237,7 @@ display: inline; /* Left Content */ .video-div{ +position:relative; border: 2px solid #cc433c; margin-bottom: 15px; -webkit-box-shadow: -1px 1px 1px #d9d9d9; @@ -486,14 +487,3 @@ footer .footer_drumbeat{ width:480px; } -#sub { -position:absolute; -top:350px; -left:300px; -color:white; -font-weight:bold; -font-family:sans-serif; -text-shadow:black 1px 1px 3px; -width:820px; -font-size:22px; -} diff --git a/xml/webMadeMovies.xml b/xml/webMadeMovies.xml index 6309526..320cee7 100644 --- a/xml/webMadeMovies.xml +++ b/xml/webMadeMovies.xml @@ -55,14 +55,14 @@ you can do everything at home with the Internet - This video made exclusively for drumbeat.org + This video made exclusively for drumbeat.org - + A Shared Culture, Jesse Dylan - + Celine Celine @@ -74,8 +74,8 @@ Celine Celine - - + +