- <html>
- <head>
- <title>html5 video demo</title>
- <script src="http://widgets.twimg.com/j/2/widget.js"></script>
- <script src="popcorn.js"></script>
- <script src="http://code.jquery.com/jquery.js"></script>
- <script src="ihttp://twitter.com/statuses/user_timeline/dharmmotyar.json?callback=showAvatar&count=1"></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;
- }
-<html>
++<html>
+ <head>
+ <title>html5 video demo</title>
+ <script src="http://code.jquery.com/jquery.js"></script>
+ <script src="http://google.com/jsapi"></script>
+ <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
+ <script src="http://widgets.twimg.com/j/2/widget.js"></script>
+ <script>google.load("language", "1");</script>
+ <script>google.load("elements", "1", {packages : ["newsshow"]});</script>
+ <script src="popcorn.js"></script>
+ <link href="style.css" rel="stylesheet" type="text/css" />
+ <script type="text/javascript">
+ $(document).ready(function () {
+ //Show hide the contents
+ $(".collapse").click(function () {
+ $(this).next(".content").slideToggle("fast");
+ });
+ //Swap class names
+ $(".collapse").toggle(function () {
+ $(this).addClass("expand");
+ }, function () {
+ $(this).removeClass("expand");
+ });
+ $(".collapse").toggle(function () {
+ $("span", this).text('Expand');
+ }, function () {
+ $("span", this).text('Collapse');
+ });
+ });
+ </script>
+ </head>
- #container {
- width:850px;
- margin:auto 50px;
- border:1px solid #ccc;
- background:white;
- padding:20px;
- position:relative;
- }
+ <body>
+ <!-- Start First Container Div -->
+ <div class="container-top">
+ <!-- Start Second Container Div -->
+ <div class="container-bot">
+ <!-- Start Wrapper Div -->
+ <div class="wrapper">
+ <!-- Start Header -->
+ <header id="global-header">
+ <a href="http://www.drumbeat.org/" class="logo"><img src="images/drumbeat_logo.png" alt="drumbeat_logo" width="" height="" /></a>
- #sub {
- position:absolute;
- top:435px;
- left:40px;
- color:#eee;
- font-weight:bold;
- font-family:sans-serif;
- text-shadow:black 1px 1px 3px;
- width:820px;
- font-size:25px;
- }
+ <!-- Start Login/Signup -->
+ <nav id="login">
+ <ul>
+ <li><a href="#">log in</a></li>
+ <li><a href="#">sign up</a></li>
+ </ul>
+ </nav>
+ <!-- End Login/Signup -->
- #map {
- border: solid 1px #000;
- width: 200px;
- height: 200px;
- }
+ <!-- Start Primary Links -->
+ <nav id="primary-links">
+ <ul>
+ <li><a title="" href="http://www.drumbeat.org/about">About</a></li>
+ <li><a title="" href="http://www.drumbeat.org/projects">Projects</a></li>
+ <li><a title="" href="http://www.drumbeat.org/people">People</a></li>
+ <li><a title="" href="http://www.drumbeat.org/events">Events</a></li>
+ <li><a title="" href="http://indofolio.com/civicrm/contribute/transact?reset=1&id=3?reset=1&id=3">Donate</a></li>
+ </ul>
+ </nav>
+ <!-- End Primary Links -->
- #credits {
- position:absolute;
- overflow:hidden;
- background-color:#333;
- border-left:1px solid #333;
- }
-
- #credits .column {
- float:left;
- position:absolute;
- height:100%;
- top:0px;
- margin:0px;
- padding:0px;
- background-color:#555;
- overflow:auto;
- border-right:1px #666 solid;
- }
-
- .play {
- background:url('play.png') left center no-repeat;
- }
+ </header>
+ <!-- End Header -->
+ <!-- Start Contents -->
+ <div id="contents">
+ <!-- Start Left Contents -->
+ <div class="left-content">
+ <!-- Start Video Div -->
+ <div class="video-div">
+ <video width="530px" height="299px" src="http://a52.video2.blip.tv/7320003802153/Etherworks-WebMadeMovies3BuildingABetterInternet799.ogg" data-timeline-sources="xml/webMadeMovies.xml" controls></video>
+ <div id="sub"></div>
+ <!-- Start Video Info -->
+ <div class="video-info">
+ <!-- Start Choose Language -->
+ <div class="choose-language">
+ <h2>Choose your language</h2>
+ <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>
+ </select>
+ <div id="credit">
+ with help from
+ <br />
+ <a href="http://google.com/translate">Google Translate</a> and <a href="http://jquery.com">
+ jQuery</a>
+ </div>
+ </div>
+ <!-- End Choose Language -->
+ <!-- Start Foot Notes -->
+ <div class="foot-notes">
+ <h2>
+ This video's footnotes</h2>
+ <p id="footnotediv"></p>
+ </div>
+ <!-- End Foot Notes -->
+ </div>
+ <!-- End Video Info -->
+ </div>
+ <!-- End Video Div -->
+ <h1>
+ <span>In this video: <strong id="inthisvideo"></strong></span>
+ </h1>
+ <!-- Start Column A -->
+ <div class="columna">
+ <section>
+ <h3><img src="images/logo_twitter.png" alt="Twitter Updates" width="" height="" />
+ <span> </span></h3>
+ <a href="#" class="collapse"><span>Collapse</span></a>
+ <div id="personaltwitter" class="content"></div>
+ </section>
+
+ </div>
+ <!-- End Column A -->
+ <!-- Start Column B -->
+ <div class="columnb">
+ <section>
+ <h3><img src="images/logo_flickr.png" alt="Flickr Images" width="" height="" />
+ <span> </span></h3>
+ <a href="#" class="collapse"><span>Collapse</span></a>
+ <div id="personalflickr" class="content"></div>
+ </section>
+ </div>
+ <!-- End Column B -->
+ </div>
+ <!-- End Left Contents -->
+ <!-- Start Right Contents -->
+ <div class="right-content">
+ <h1>
+ <span>Related to this video</span></h1>
+ <!-- Start Column A -->
+ <div class="columna">
+ <section>
+ <div id="container3" class="google-map-title">
+ <h4>Filmed in:</h4>
+ <span id="mapinfo"></span>
+ </div>
- #credits li {
- list-style-type:none;
- }
- #credits li.selected { border-left:2px solid #FADBAF; }
+ <div id="container2" class="google-map"></div>
+
+ </section>
+ <section>
+ <h3><img src="images/logo_twitter.png" alt="Twitter" width="" height="" /></h3>
+ <a href="#" class="collapse"><span>Collapse</span></a>
+ <div id="twitter" class="content"></div>
+ </section>
+ </div>
+ <!-- End Column A -->
+ <!-- Start Column B -->
+ <div class="columnb">
+ <section>
+ <h3><img src="images/logo_wiki.png" alt="Wikipedia" width="" height="" /></h3>
+ <a href="#" class="collapse"><span>Collapse</span></a>
- #credits li a {
- display:block;
- text-decoration:none;
- color:#efefef;
- font-weight:bold;
- font-family:sans-serif;
- text-shadow:black 1px 1px 3px;
- padding:12px 14px;
- border-bottom:1px solid #666;
- }
+ <div class="content">
+ Use the #Evernote Fx Add-on to save, organize, & search info you find on the Web http://bit.ly/evernotewebclipper /via @rockyourfirefox
+ <a href="#" class="more">more</a>
+ </div>
+ </section>
+ <section>
+ <h3><img src="images/logo_flickr.png" alt="Flickr Images" width="" height="" /></h3>
+ <a href="#" class="collapse"><span>Collapse</span></a>
- #credits li a:hover {
- color:#FADBAF;
- }
- </style>
- </head>
- <body>
- <div id="container">
- <div id="credits" style="display:none">
- <div id="credit_inner">
- </div>
- </div>
- <video src="video.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="footnotediv"></div><br />
- <div id="attributiondiv"></div><br />
- <div id="tagthisvideo">In this video:<span id="inthisvideo"></span></div><br />
- <div>
- <div id="map">
- </div>
- <p id="mapinfo">
- </p>
+ <div id="flickr" class="content"></div>
+ </section>
+
+ </div>
+ <!-- End Column B -->
+
+ <h1></h1>
+ <section>
+ <h3><img src="images/logo_google_news.png" alt="Google News" width="" height="" />
+ </h3>
+ <div id="googlenewsdiv">
+ </div>
+ </section>
+ <h1><span>This video's copyright information</span></h1>
+ <section>
+ <div id="container5">
+ Attribution
+ </div>
+ </section>
+ </div>
+ <!-- End Right Contents -->
+ </div>
+ <!-- End Contents -->
+ <footer>
+ <div class="footer_webmade">
+ <img src="images/footer_webmade.png" alt="footer_webmade" width="" height="" />
+ <p>Web Made Movies is a Mozilla's Open video lab
+ <a href="#">Learn More <span>»</span></a>
+ </p>
+ </div>
+ <div class="footer_drumbeat">
+ <img src="images/footer_drumbeat.png" alt="footer_drumbeat" width="" height="" /><p>Innovation on the open web, </br> powered by everybody.</p>
+ </div>
+ <div class="copyright">Portions of this content are ©2010 by individual drumbeat.org contributors. Content available under a Creative Commons license.</div>
+ </footer>
</div>
- <div id="twitter"></div>
- <div id="flickr"></div>
+ <!-- End Wrapper Div -->
</div>
- </body>
- </html>
+ <!-- End First Container Div -->
+ </div>
+ <!-- End Second Container Div -->
+ </body>
+ </html>
};
};
+ ////////////////////////////////////////////////////////////////////////////
+ // GoogleNews Command
+ ////////////////////////////////////////////////////////////////////////////
+
+ var GoogleNewsCommand = function(name, params, text, videoManager) {
+ VideoCommand.call(this, name, params, text, videoManager);
+ this.target = document.createElement('div');
+ this.target.setAttribute('style', 'display:none;border:0px;');
+ document.getElementById(this.params.target).appendChild(this.target);
+ this.target.setAttribute('id', this.id);
+ var content = document.getElementById(this.id);
+ var options = {
+ format : "300x250",
+ queryList : [
+ {q: this.params.topic || "Top Stories"}
+ ]
+ };
+ var newsShow = new google.elements.NewsShow(content, options);
+ this.onIn = function() {
+ this.target.setAttribute('style', 'display:inline');
+ };
+ this.onOut = function() {
+ this.target.setAttribute('style', 'display:none');
+ };
+ };
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Credits Command
+ ////////////////////////////////////////////////////////////////////////////
+ var credits = {
+ add: function() {
+
+ }
+ }
+ var CreditsCommand = function(name, params, text, videoManager) {
+ VideoCommand.call(this, name, params, text, videoManager);
+ $("#credits")
+ .width(this.videoManager.videoElement.clientWidth)
+ .height(this.videoManager.videoElement.clientHeight)
+ this.params["in"]=this.videoManager.videoElement.duration-.1;
+ this.params["out"]=this.videoManager.videoElement.duration+.1;
+ var that = this;
+ this.onIn = function() {
+ $("#credits").show();
+ $("#choices").animate({ right:'+=200px' }, 1000);
+ CreditsCommand.add( [
+ {
+ text: "Play Again",
+ click:function() {
+ CreditsCommand.killCol(0)
+ $('video')[0].currentTime=0;
+ }
+ },
+ {
+ text: "People",
+ next:[
+ {
+ text: "Nick Cammarata",
+ next: [
+ { text: "Twitter", href: "http://twitter.com/nicklovescode" },
+ { text: "Flickr", href: "http://flickr.com/nicklovescode" }
+ ]
+ },
+ {
+ text: "Celine Celine",
+ href: "http://twitter.com/celinecelines"
+ }
+ ]
+ },
+ { text: "Places" },
+ { text: "Articles" }
+ ]);
+ };
+ this.onOut = function() {
+ $("#choices").css("right","-200px");
+ $("#credits").hide();
+ };
+ };
+ CreditsCommand.colIndex = 0;
+ CreditsCommand.killCol = function(index, callback) {
+ $(".column").each(function() {
+ if ($(this).attr("colindex")>index) {
+ $(this).addClass("removing").animate( { left: -$(this).outerWidth() + "px" }, 1200, function() {
+ $(this).remove();
+ });
+ }
+ });
+ if (callback) callback();
+ }
+
+ CreditsCommand.add = function(items) {
+ CreditsCommand.colIndex++;
+ var ul = $("<ul></ul>")
+ .addClass('column')
+ .attr('colindex',parseInt(CreditsCommand.colIndex))
+ $.each(items, function(i, val) {
+ var li = $(document.createElement('li'))
+ .append($(document.createElement('a'))
+ .text(val.text)
+ .attr("href",val.href||"#")
+ .attr("target",val.href?"_blank":""))
+ .appendTo(ul)
+ .addClass('play')
+ .click(function() {
+ if (val.href) return true;
+ var colIndex = $(this).parent().attr('colindex');
+ if (CreditsCommand.colIndex>colIndex) {
+ CreditsCommand.killCol(colIndex);
+ CreditsCommand.colIndex = colIndex;
+ }
+ var hasClass = $(this).hasClass('selected');
+ if (!hasClass) {
+ if (val.click) val.click();
+ if (val.next) CreditsCommand.add(val.next);
+ }
+ $(this)
+ .parent()
+ .find('.selected')
+ .removeClass('selected')
+ if (!hasClass) $(this).addClass('selected');
+ })
+ });
+ var width = 0;
+ $(".column:not(.removing)").each(function() {
+ width+=$(this).outerWidth();
+ })
+ ul
+ .appendTo("#credit_inner")
+ .css("z-index",1000-CreditsCommand.colIndex)
+ .css("left",-ul.outerWidth())
+ .animate({
+ left: width + "px"
+ },750)
+ }
+
////////////////////////////////////////////////////////////////////////////
// TagThisPerson Command
////////////////////////////////////////////////////////////////////////////
create: function(name, params, text, videoManager) {
return new AttributionCommand(name, params, text, videoManager);
}
- },
- flickr: {
- create: function(name, params, text, videoManager) {
- return new FlickrCommand(name, params, text, videoManager);
- }
+ },
+ googlenews: {
+ create: function(name, params, text, videoManager) {
+ return new GoogleNewsCommand(name, params, text, videoManager);
+ }
}
};