Home | History | Annotate | Download | only in channels
      1 fullpage=true
      2 page.title=Google I/O 13
      3 @jd:body
      4 <div id="butterbar-wrapper" >
      5   <div id="butterbar" >
      6     <div id="butterbar-message">
      7 <a target="_blank" href="https://docs.google.com/a/google.com/forms/d/1EHLPGqhbxj2HungHRRN4_0K9TGpc-Izy-u46vBDgS8Q/viewform">
      8       Take the Android Developer Survey</a>
      9     </div>
     10   </div>
     11 </div>
     12 
     13 <style>
     14 #ioplayer-frame {
     15   z-index:10;
     16   width:703px;
     17   height:396px;
     18   margin:0;
     19   position:relative;
     20 }
     21 
     22 #noplayer-message {
     23   position:absolute;
     24   top:50%;left:0;
     25   width:100%;
     26   z-index:-1;
     27   text-align:center;
     28   display:none;
     29 }
     30 
     31 h1 {
     32   font-weight:100;
     33   font-size:40px;
     34   line-height:30px;
     35   margin:30px 0 10px 0px;
     36   color:#000;
     37 }
     38 
     39 h2 {
     40   font-weight:100;
     41   font-size:30px;
     42   line-height:30px;
     43   margin:12px 0 10px 0px;
     44   color:#000;
     45   float:left;
     46   display:block;
     47 }
     48 
     49 .col-4 h2 {
     50   margin-top:40px;
     51 }
     52 
     53 ul.videos {
     54   list-style:none;
     55   margin:0;
     56   width:auto;
     57 }
     58 ul.videos li {
     59   display:block;
     60   float:left;
     61   position:relative;
     62   margin:0 2px 2px 0;
     63   background-repeat:no-repeat !important;
     64   background-size:320px auto;
     65   background-position:10% 50%;
     66   z-index:1; /* IE: the description is 2 */
     67 }
     68 ul.videos li a {
     69   color:#fff !important;
     70   display:block;
     71   margin:0;
     72   padding:8px 12px;
     73   width:209px;
     74   height:134px;
     75   box-shadow:inset 500px 500px 999px rgba(000, 000, 000, 0.2);
     76   background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(0,0,0,0.8)), color-stop(1, transparent));
     77   background-image: -webkit-linear-gradient(top, rgba(0,0,0,0.8), transparent);
     78   background-image: -moz-linear-gradient(top, rgba(0,0,0,0.8), transparent);
     79   background-image: -o-linear-gradient(top, rgba(0,0,0,0.8), transparent);
     80   background-image: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
     81   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cc000000', endColorstr='#00ffffff',GradientType=0 ); /* IE6-9 */
     82 }
     83 ul.videos.featured li {
     84   margin:0 0 2px;
     85 }
     86 ul.videos.featured li a {
     87   margin:0;
     88   height:115px;
     89 }
     90 ul.videos li a:hover {
     91   box-shadow:inset 500px 500px 999px rgba(255,255,255, 0.6);
     92 }
     93 ul.videos li h4 {
     94   text-shadow:1px 1px 0 rgba(0,0,0,0.8);
     95   font-size:18px;
     96   line-height:22px;
     97   color:#fff;
     98   margin:0;
     99   height:100%; /* IE: to fill clickable area */
    100 }
    101 
    102 ul.videos li .description-frame {
    103   display:none;
    104   z-index:2; /* IE: the li is 1 */
    105 }
    106 ul.videos li a:hover .description-frame {
    107   display:block;
    108   position:absolute;
    109   top:80px;
    110   left:8px;
    111   z-index:99;
    112 }
    113 ul.videos .description {
    114   background:#fff;
    115   width:200px;
    116   padding:8px;
    117   -webkit-border-radius:1px;
    118   -moz-border-radius:1px;
    119   border-radius:1px;
    120   -moz-box-shadow: 0 2px 3px 2px rgba(000,000,000, 0.4);
    121   -webkit-box-shadow: 0 2px 3px 2px rgba(000,000,000, 0.4);
    122   box-shadow: 0 2px 3px 2px rgba(000,000,000, 0.4);
    123   font-size:11px;
    124   line-height:12px;
    125   color:#000;
    126   overflow:hidden;
    127 }
    128 ul.videos .arrow-up {
    129   position:absolute;
    130   left:15px;
    131   top:-11px;
    132   width:0;
    133   height:0;
    134   border-bottom:12px solid #fff;
    135   border-left:12px solid transparent;
    136   border-right:12px solid transparent;
    137 }
    138 ul.videos .arrow-down {
    139   position:absolute;
    140   left:15px;
    141   bottom:-11px;
    142   width:0;
    143   height:0;
    144   border-top:12px solid #fff;
    145   border-left:12px solid transparent;
    146   border-right:12px solid transparent;
    147 }
    148 
    149 ul.videos span.tag {
    150   font-size:.9em;
    151   font-weight:normal;
    152   display: block;
    153   position: absolute;
    154   bottom: 0;
    155   color: #fff;
    156   left: 0;
    157   padding: 4px;
    158   border-top-right-radius:4px;
    159   text-transform:uppercase;
    160   text-shadow: none;
    161 }
    162 ul.videos span.tag.design {
    163   background-color:rgba(51, 181, 229, .7);
    164   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cc33b5e5', endColorstr='#cc33b5e5',GradientType=0 ); /* IE6-9 */
    165 }
    166 ul.videos span.tag.develop {
    167   background-color:rgba(255, 136, 0, .7);
    168   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ccff8800', endColorstr='#ccff8800',GradientType=0 ); /* IE6-9 */
    169 }
    170 ul.videos span.tag.distribute {
    171   background-color:rgba(153, 204, 0, .7);
    172   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cc99cc00', endColorstr='#cc99cc00',GradientType=0 ); /* IE6-9 */
    173 }
    174 
    175 </style>
    176 
    177 
    178 
    179 
    180 
    181 
    182 
    183 <div class="wrap">
    184 
    185   <div class="col-12" style="width:704px;margin:0">
    186     <h1>Android @ Google I/O 13</h1>
    187     <div id="ioplayer-frame">
    188       <div id="noplayer-message">
    189         <!-- busted flash player message -->
    190         Your video is supposed to appear here.<br/>
    191         Make sure you have the <a href="//get.adobe.com/flashplayer/" target="_blank">Flash&reg; Player</a>.
    192       </div>
    193       <div id="player"><!-- Youtube embeds here... actually replaces this div --></div>
    194     </div>
    195   </div>
    196 
    197   <div class="col-4" style="margin:0;width:234px;padding:0 0 0 2px">
    198     <h2 class="norule">Most Popular</h2>
    199     <ul class="videos featured" id="playlist2">
    200     </ul>
    201   </div>
    202 </div>
    203 
    204 <div class="wrap">
    205 
    206     <div style="position:absolute;width:940px;text-align:right">
    207       <a href="//www.youtube.com/AndroidDevelopers" target="_blank">
    208       More on YouTube
    209         <img src="//www.youtube.com/favicon.ico" style="border:0;width:16px;height:16px;vertical-align:middle;margin:0 2px 3px 2px">
    210       </a>
    211     </div>
    212   <div style="width:944px;overflow:hidden;padding:0 0 20px">
    213     <h2 class="norule">All Videos</h2>
    214     <ul class="videos" id="playlist1" style="clear:left">
    215       <span id="videos-design"></span>
    216       <span id="videos-develop"></span>
    217       <span id="videos-distribute"></span>
    218     </ul>
    219   </div>
    220 
    221 </div>
    222 
    223 <br class="clearfix"/>
    224 
    225       
    226       
    227       
    228       
    229       
    230       
    231       
    232       
    233       
    234 
    235 <script src="//swfobject.googlecode.com/svn/trunk/swfobject/swfobject.js" type="text/javascript"></script>
    236 <script type="text/javascript">
    237 
    238 /* Load a video into the player box.
    239  * @param id        The YouTube video ID
    240  * @param title     The video title to display in the player box (character escaped)
    241  * @param autoplay  Whether to automatically play the video
    242  */
    243 function loadVideo(id, title, autoplay) {
    244   var url = '//www.youtube.com/v/' + id + '&rel=1&border=0&fs=1' + (autoplay?'&autoplay=1':'');
    245   swfobject.embedSWF(url, 'player', '704', '397', '9.0.0', false, false, {allowfullscreen: 'true'});
    246   $('body,html').animate({ scrollTop: 0 }, "slow");
    247   setTimeout(function(){$('#noplayer-message').show()}, 2000);
    248 }
    249 
    250 
    251 function buildPlaylistDesign(data) {
    252   buildPlaylist(data, $('ul#playlist1 #videos-design'), "design");
    253 }
    254 
    255 function buildPlaylistDevelop(data) {
    256   buildPlaylist(data, $('ul#playlist1 #videos-develop'), "develop");
    257 }
    258 
    259 function buildPlaylistDistribute(data) {
    260   buildPlaylist(data, $('ul#playlist1 #videos-distribute'), "distribute");
    261 }
    262 
    263 function buildPlaylist2(data) {
    264   buildPlaylist(data, $('ul#playlist2'));
    265 }
    266 
    267 function buildPlaylist(data, ul, tag) {
    268 
    269   var MAX_DESC_LENGTH = 200; // the length at which we will trim the description
    270   var feed = data.feed;
    271   var entries = feed.entry || [];
    272   var playlistId = feed.yt$playlistId.$t;
    273 
    274   // Loop through each entry (each video) and add it to the '#DevelopersLive' list
    275   for (var i = 0; i < entries.length; i++) {
    276     var entry = entries[i];
    277     var title = entry.title.$t;
    278     var id = entry.media$group.yt$videoid.$t;
    279     // get 180x320 thumbnail
    280     var thumbs = entry.media$group.media$thumbnail;
    281     var thumbUrl;
    282     for (var j = 0; j < thumbs.length; j++) {
    283       if (thumbs[j].yt$name == "hqdefault") {
    284         thumbUrl = thumbs[j].url;
    285       }
    286     }
    287 
    288     // chop out the google io title
    289     title = title.substr(title.indexOf("-") + 1, title.length);
    290 
    291     var fullDescription = entry.media$group.media$description.$t;
    292     var playerUrl = entry.media$group.media$content[0].url;
    293     var shortDescription = fullDescription.substr(0, MAX_DESC_LENGTH);
    294     // further shorten description if there's a url (remove it)
    295     var httpindex = shortDescription.indexOf("http://");
    296     if (httpindex != -1) {
    297       shortDescription = shortDescription.substring(0,httpindex);
    298     }
    299     shortDescription += shortDescription.length == MAX_DESC_LENGTH ? "..." : ""; // add ellipsis if we've chopped the description
    300 
    301     var a = $('<a href="#" id="' + id + '" '
    302           + 'onclick="loadVideo(\'' + id + '\',\'' + escape(title) + '\',true); return false;" />');
    303     var pShortDescription = $('<div class="description-frame"><div class="arrow-up"></div>'
    304           + '<div class="description">' + shortDescription + '</div></div>');
    305     var h4Title = "<h4>" + title + "</h4>";
    306     var li = $('<li style="background-image:url(\'' + thumbUrl +'\')" />');
    307 
    308     li.append(a);
    309     a.append(h4Title).append(pShortDescription);
    310 
    311     if (tag !== undefined) {
    312       var $tag = $('<span class="tag ' + tag + '">' + tag + '</span>');
    313       a.append($tag);
    314     }
    315 
    316     ul.append(li);
    317 
    318 
    319     // put the first video in the player 
    320     if ((tag == "design") && (i == 0)) {
    321       loadVideo(id, escape(title), false);
    322     }
    323   }
    324 }
    325 
    326 
    327 /* Request the playlist feeds from YouTube */
    328 function showDevelopersLivePlaylist() {
    329   var playlistId = "PLWz5rJ2EKKc-qVhMuAprIFYFbCotdgJKq"; /* IO 13 - Design */
    330   $.getScript("//gdata.youtube.com/feeds/api/playlists/"
    331           + playlistId +
    332           "?v=2&alt=json-in-script&max-results=50&callback=buildPlaylistDesign&orderby=position");
    333 
    334   playlistId = "PLWz5rJ2EKKc9rkwO9yBosRvkQBJd5utmR"; /* IO 13 - Develop */
    335   $.getScript("//gdata.youtube.com/feeds/api/playlists/"
    336           + playlistId +
    337           "?v=2&alt=json-in-script&max-results=50&callback=buildPlaylistDevelop&orderby=position");
    338 
    339   playlistId = "PLWz5rJ2EKKc-1WjgQqL0B4OQtbLfhMlB2"; /* IO 13 - Distribute */
    340   $.getScript("//gdata.youtube.com/feeds/api/playlists/"
    341           + playlistId +
    342           "?v=2&alt=json-in-script&max-results=50&callback=buildPlaylistDistribute&orderby=position");
    343 
    344 
    345   playlistId = "PLWz5rJ2EKKc9WGUwq2gQ-coU3fSyexgOx"; /* IO 13 - The Android Sessions */
    346   $.getScript("//gdata.youtube.com/feeds/api/playlists/"
    347           + playlistId +
    348           "?v=2&alt=json-in-script&max-results=3&callback=buildPlaylist2&orderby=viewCount");
    349 }
    350 
    351 showDevelopersLivePlaylist();
    352 
    353 
    354 </script>