blob: 7c7aca44667c47ee90b739302105cdfc0934a359 [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'});
Scott Main79bff4c2013-05-29 16:00:19 -0700232 $('body,html').animate({ scrollTop: 0 }, "slow");
Scott Main896f61d2013-05-28 17:59:12 -0700233 setTimeout(function(){$('#noplayer-message').show()}, 2000);
Scott Main896f61d2013-05-28 17:59:12 -0700234}
235
236
237function buildPlaylistDesign(data) {
238 buildPlaylist(data, $('ul#playlist1 #videos-design'), "design");
239}
240
241function buildPlaylistDevelop(data) {
242 buildPlaylist(data, $('ul#playlist1 #videos-develop'), "develop");
243}
244
245function buildPlaylistDistribute(data) {
246 buildPlaylist(data, $('ul#playlist1 #videos-distribute'), "distribute");
247}
248
249function buildPlaylist2(data) {
250 buildPlaylist(data, $('ul#playlist2'));
251}
252
253function buildPlaylist(data, ul, tag) {
254
255 var MAX_DESC_LENGTH = 200; // the length at which we will trim the description
256 var feed = data.feed;
257 var entries = feed.entry || [];
258 var playlistId = feed.yt$playlistId.$t;
259
260 // Loop through each entry (each video) and add it to the '#DevelopersLive' list
261 for (var i = 0; i < entries.length; i++) {
262 var entry = entries[i];
263 var title = entry.title.$t;
264 var id = entry.media$group.yt$videoid.$t;
265 // get 180x320 thumbnail
266 var thumbs = entry.media$group.media$thumbnail;
267 var thumbUrl;
268 for (var j = 0; j < thumbs.length; j++) {
269 if (thumbs[j].yt$name == "hqdefault") {
270 thumbUrl = thumbs[j].url;
271 }
272 }
273
274 // chop out the google io title
275 title = title.substr(title.indexOf("-") + 1, title.length);
276
277 var fullDescription = entry.media$group.media$description.$t;
278 var playerUrl = entry.media$group.media$content[0].url;
279 var shortDescription = fullDescription.substr(0, MAX_DESC_LENGTH);
280 // further shorten description if there's a url (remove it)
281 var httpindex = shortDescription.indexOf("http://");
282 if (httpindex != -1) {
283 shortDescription = shortDescription.substring(0,httpindex);
284 }
285 shortDescription += shortDescription.length == MAX_DESC_LENGTH ? "..." : ""; // add ellipsis if we've chopped the description
286
287 var a = $('<a href="#" id="' + id + '" '
288 + 'onclick="loadVideo(\'' + id + '\',\'' + escape(title) + '\',true); return false;" >');
289 var pShortDescription = $('<div class="description-frame"><div class="arrow-up"></div>'
290 + '<div class="description">' + shortDescription + '</div></div>');
291 var h4Title = "<h4>" + title + "</h4>";
292 var li = $('<li style="background-image:url(\'' + thumbUrl +'\')">');
293
294 li.append(a);
295 a.append(h4Title).append(pShortDescription);
296
297 if (tag !== undefined) {
298 var $tag = $('<span class="tag ' + tag + '">' + tag + '</span>');
299 a.append($tag);
300 }
301
302 ul.append(li);
303
304
305 // put the first video in the player
306 if ((tag == "design") && (i == 0)) {
307 loadVideo(id, escape(title), false);
308 }
309 }
310}
311
312
313/* Request the playlist feeds from YouTube */
314function showDevelopersLivePlaylist() {
315 var playlistId = "PLWz5rJ2EKKc-qVhMuAprIFYFbCotdgJKq"; /* IO 13 - Design */
316 $.getScript("//gdata.youtube.com/feeds/api/playlists/"
317 + playlistId +
318 "?v=2&alt=json-in-script&max-results=50&callback=buildPlaylistDesign&orderby=position");
319
320 playlistId = "PLWz5rJ2EKKc9rkwO9yBosRvkQBJd5utmR"; /* IO 13 - Develop */
321 $.getScript("//gdata.youtube.com/feeds/api/playlists/"
322 + playlistId +
323 "?v=2&alt=json-in-script&max-results=50&callback=buildPlaylistDevelop&orderby=position");
324
325 playlistId = "PLWz5rJ2EKKc-1WjgQqL0B4OQtbLfhMlB2"; /* IO 13 - Distribute */
326 $.getScript("//gdata.youtube.com/feeds/api/playlists/"
327 + playlistId +
328 "?v=2&alt=json-in-script&max-results=50&callback=buildPlaylistDistribute&orderby=position");
329
330
331 playlistId = "PLWz5rJ2EKKc9WGUwq2gQ-coU3fSyexgOx"; /* IO 13 - The Android Sessions */
332 $.getScript("//gdata.youtube.com/feeds/api/playlists/"
333 + playlistId +
334 "?v=2&alt=json-in-script&max-results=3&callback=buildPlaylist2&orderby=viewCount");
335}
336
337showDevelopersLivePlaylist();
338
339
340</script>