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