instrumentation: add next-share/
[cs-p2p-next.git] / instrumentation / next-share / BaseLib / Transport / wikipedia.html
1 <html>\r
2 <head>\r
3 <link rel="stylesheet" type="text/css" href="trial.css">\r
4 <title>Wikipedia P2P Video Streaming Test</title>\r
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
6 <style type="text/css">\r
7 <!--\r
8 body {\r
9         background-color: #FFFFFF;\r
10 }\r
11 .style4 {\r
12         font-size: 24pt;\r
13         color: #333333;\r
14 }\r
15 .style7 {color: #666666; font-style: italic;}\r
16 -->\r
17 </style>\r
18 </head>\r
19 <body>\r
20 <table>\r
21 <tr>\r
22   <td><a href="http://www.p2p-next.org/"><img src="images/p2p-next_logo.png" border=0></a></td>\r
23   <td class="header">Wikipedia P2P Video Streaming Test</td>\r
24   <td><a href="http://www.p2p-next.org/"><img src="images/p2p-next_logo.png" border=0></a></td>\r
25 </tr>\r
26 </table>\r
27 <center>\r
28 <table class="container">\r
29 <tr><td valign="top">\r
30 <table>\r
31 \r
32 \r
33 <!-- Step 1 -->\r
34 <script type="text/javascript">\r
35 \r
36 if (navigator.appName == "Netscape")\r
37 {\r
38 document.write('<tr>');\r
39 document.write('  <td  class="nr"><img src="images/01_120px.png"  height="120"></td>');\r
40 document.write('  <td><span class="title">Install SwarmTransport for Firefox</span>');\r
41 document.write('    <span class="text">');\r
42 document.write('    <ol type="a">');\r
43 document.write('    <li> Open the <a href="http://www.tribler.org/trac/wiki/WikimediaCooperation">XPI for your platform</a> with Firefox');\r
44 document.write('    <li> Restart Firefox, and revisit this page.');\r
45 document.write('    </ol>');\r
46 document.write('    For IE, visit this page using IE, or look in PageSource');\r
47 document.write('    </span>');\r
48 document.write('  </td>');\r
49 document.write('</tr>');\r
50 }\r
51 else\r
52 {\r
53 document.write('<tr>');\r
54 document.write('  <td  class="nr"><img src="images/01_120px.png"  height="120"></td>');\r
55 document.write('  <td><span class="title">Install SwarmPlugin for Internet Explorer</span>');\r
56 document.write('    <span class="text">');\r
57 document.write('    <ol type="a">');\r
58 document.write('    <li> Run the <a href="http://www.tribler.org/trac/wiki/WikimediaCooperation">SwarmPlugin-Ogg installer</a> for IE');\r
59 document.write('    <li> Revisit this page.');\r
60 document.write('    </ol>');\r
61 document.write('    For Firefox, visit this page using Firefox, or look in PageSource');\r
62 document.write('    </span>');\r
63 document.write('  </td>');\r
64 document.write('</tr>');\r
65 }\r
66 </script>\r
67 \r
68 \r
69 <!-- Step 2 -->\r
70 <tr>\r
71   <td class="nr"><img src="images/02_120px.png"  height="120" align="baseline"></td>\r
72   <td><span class="title">Watch these Wikipedia videos via P2P</span>\r
73     <span class="text"> </a> \r
74 </span>\r
75 <p>\r
76 \r
77 \r
78 <!-- NextShare Tstream Lookup Service -->\r
79 <script src="http://wikipedia.p2p-next.org/tlookup.js"></script>\r
80 \r
81 \r
82 <!-- NextShare Common Javascript Code -->\r
83 <script>\r
84 \r
85 // Code for video tag error reporting \r
86 function failed(e) {\r
87    // video playback failed - show a message saying why\r
88    switch (e.target.error.code) {\r
89      case e.target.error.MEDIA_ERR_ABORTED:\r
90        alert('You aborted the video playback.');\r
91        break;\r
92      case e.target.error.MEDIA_ERR_NETWORK:\r
93        alert('A network error caused the video download to fail part-way.');\r
94        break;\r
95      case e.target.error.MEDIA_ERR_DECODE:\r
96        alert('The video playback was aborted due to a corruption problem or because the video used features your browser did not support.');\r
97        break;\r
98      case e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:\r
99        alert('The video could not be loaded, either because the server or network failed or because the format is not supported.');\r
100        break;\r
101      default:\r
102        alert('An unknown error occurred, code:'+e.target.error.code);\r
103        break;\r
104    }\r
105  }\r
106 \r
107 // Code for IE8 SwarmPlugin\r
108 function debugonclick(vlcobj)\r
109 {\r
110     newwindow2=window.open('','name','height=400,width=640,scrollbars=1,resizable=1');\r
111     var tmp = newwindow2.document;\r
112     tmp.write('<html><head><title>popup</title>');\r
113     tmp.write('</head><body><p>SwarmPlugin Debugging Popup</p>');\r
114 \r
115     tmp.write("Number of log messages "+vlcobj.log.messages.count);\r
116 \r
117     var iter = vlcobj.log.messages.iterator();\r
118     while(iter.hasNext)\r
119     {\r
120         msg = iter.next();\r
121         tmp.write(msg.message+"<br>");\r
122     }\r
123 \r
124     tmp.write('</body></html>');\r
125     tmp.close();\r
126 \r
127 }\r
128 \r
129 \r
130 function seek(vlcobj,percentage)\r
131 {\r
132     vlcobj.input.position = percentage\r
133 }\r
134 \r
135 \r
136 function writeplugin(vlcid,url)\r
137 {\r
138         // 1. Write plugin HTML\r
139         writeobject(vlcid,url);\r
140         \r
141         // 2. Write statusline HTML\r
142         writestatusline(vlcid);\r
143         \r
144         // 3. Write controls HTML\r
145         document.write('<p class="center">');\r
146         writecontrols(vlcid);\r
147         document.write('</p>');\r
148         \r
149         // 4. Periodically retrieve p2pstatus from plugin and show on page\r
150         setInterval(function() { updatestatusline(vlcid); },100);\r
151 }\r
152 \r
153 function writeobject(vlcid,url)\r
154 {\r
155         document.write('<object classid="clsid:1800B8AF-4E33-43C0-AFC7-894433C13538" ');\r
156         //document.write('codebase="http://trial.p2p-next.org/download/SwarmPlugin_IE_1.0.5.cab"');\r
157         document.write('width="320" height="240" id="'+vlcid+'" name="'+vlcid+'" events="True" target="">');\r
158         document.write('<param name="Src" value="'+url+'" />');\r
159         document.write('<param name="ShowDisplay" value="True" />');\r
160         document.write('<param name="Loop" value="False" />');\r
161         document.write('<param name="AutoPlay" value="True" />');\r
162         document.write('<param name="Toolbar" value="True" />');\r
163         document.write('</object>');\r
164 }\r
165 \r
166 function writestatusline(vlcid)\r
167 {\r
168     document.write('<em><p id="'+vlcid+'p2pstatusline">Statusline</p></em>');\r
169 }\r
170 \r
171 function updatestatusline(vlcid)\r
172 {\r
173         vlcobj = document.getElementById(vlcid);\r
174     if (vlcobj.input != null)\r
175     {\r
176         line = vlcobj.input.p2pstatus\r
177         var p2pstatusline = document.getElementById(vlcid+"p2pstatusline");\r
178         p2pstatusline.innerHTML = line\r
179     }\r
180 }\r
181 \r
182 function writecontrols(vlcid)\r
183 {\r
184         vlcfullid = 'document.'+vlcid\r
185         document.write('<input type=button value="Play" onClick="');\r
186                                                   document.write(vlcid+'.playlist.play();">');\r
187         document.write('<input type=button value="Pause" onClick="');\r
188                                                                                           document.write(vlcid+'.playlist.togglePause();">');\r
189         document.write('<input type=button value="Stop" onclick="');\r
190                                                   document.write(vlcid+'.playlist.stop();">');\r
191         document.write('<input type=button value="Debug" onclick="debugonclick(');\r
192                                                                                           document.write(vlcid+');">');\r
193         document.write('<input type=button value="Seek 25%" onclick="seek(');\r
194                                                                                           document.write(vlcid+',.25);">');\r
195         document.write('<input type=button value="Seek 50%" onclick="seek(');\r
196                                                                                           document.write(vlcid+',.5);">');\r
197         document.write('<input type=button value="Fullscreen" onClick="');\r
198                                                                                           document.write(vlcid+'.video.toggleFullscreen();">');\r
199 }\r
200 \r
201 function writep2pvideotag(videourl,posterurl)\r
202 {\r
203     if (typeof swarmTransport != 'undefined')\r
204     {\r
205             var tribeurl = "tribe://"+httpseed2tstream(videourl);\r
206             document.write('<video controls="controls" onerror="failed(event)" preload="none" poster="'+posterurl+'">');\r
207             document.write('  <source src="'+tribeurl+'"/>');\r
208             document.write('  <!-- source src="'+videourl+'"/ -->');\r
209             document.write('</video>');\r
210     }\r
211     else\r
212     {\r
213         // No SwarmTransport installed\r
214         document.write('NO SWARMTRANSPORT');\r
215             document.write('<video controls="controls" onerror="failed(event)" poster="'+posterurl+'">');\r
216             document.write('  <source src="'+videourl+'"/>');\r
217             document.write('</video>');\r
218     }\r
219 }\r
220 </script>\r
221 \r
222 \r
223 <table border="1">\r
224 \r
225 <tr>\r
226 <!-- Video 1 -->\r
227 <td>\r
228 \r
229 <!-- NextShare: Generate video code for FX or IE -->\r
230 <script type="text/javascript">\r
231 if (navigator.appName == "Netscape")\r
232 {\r
233     //\r
234     // FX: use HTML5 video tag and NextShare SwarmTransport\r
235     //\r
236     var posterurl = "http://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Welcome_to_globallives_2.0.ogv/seek%3D2-Welcome_to_globallives_2.0.ogv.jpg";\r
237     var videourl = "http://upload.wikimedia.org/wikipedia/commons/c/c3/Welcome_to_globallives_2.0.ogv";\r
238     writep2pvideotag(videourl,posterurl);\r
239 }\r
240 else\r
241 {\r
242         //\r
243         // IE8: Fallback to NextShare SwarmPlugin\r
244         //\r
245         writeplugin("vlc1","http://tracker1.p2p-next.org:6970/file?info_hash=%3E7%F1%7F%F9%C7%20%9D%BE%3D%96%10%1B%7BK%3Bs%9C%06%7E");\r
246 }\r
247 </script>\r
248 \r
249 </td>\r
250 \r
251 <td><a href="http://globallives.org" rel="nofollow">GlobalLives.org</a> is a \r
252 collaboratively built video library of human life experience that reshapes how \r
253 we as both producers and viewers conceive of cultures, nations and people \r
254 outside of our own communities. More \r
255 <a href="http://globallives.org/about/" rel="nofollow">about global lives</a>.\r
256 </td>\r
257 </tr>\r
258 \r
259 \r
260 \r
261 \r
262 <tr>\r
263 <!-- Video 2 -->\r
264 <td>\r
265 \r
266 <!-- NextShare: Generate video code for FX or IE -->\r
267 <script type="text/javascript">\r
268 if (navigator.appName == "Netscape")\r
269 {\r
270     //\r
271     // FX: use HTML5 video tag and NextShare SwarmTransport\r
272     //\r
273     var posterurl = "http://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Elephants_Dream.ogg/seek%3D13-Elephants_Dream.ogg.jpg";\r
274     var videourl = "http://upload.wikimedia.org/wikipedia/commons/b/bd/Elephants_Dream.ogg";\r
275     writep2pvideotag(videourl,posterurl);\r
276 }\r
277 else\r
278 {\r
279         //\r
280         // IE8: Fallback to NextShare SwarmPlugin\r
281         //\r
282         writeplugin("vlc2","http://tracker1.p2p-next.org:6970/file?info_hash=%ED%5D%D9%81%5E%04%0A%12%07%CE/%40%7C0d%8F%7C%15%29%CB");\r
283 }\r
284 </script>\r
285 \r
286 </td>\r
287 <td><a href="http://www.elephantsdream.org/" rel="nofollow">Elephants Dream</a> \r
288 is the world's first open movie, made entirely with open source graphics \r
289 software such as <a href="http://en.wikipedia.org/wiki/Blender">Blender</a>, \r
290 and with all production files freely available to use however you please, \r
291 under a <a href="http://en.wikipedia.org/wiki/Creative_Commons">Creative \r
292 Commons</a> license. This clip subtitles have been translated into many languages.\r
293 </td>\r
294 \r
295 </tr>\r
296 \r
297 <tr>\r
298 <!-- Video 3 -->\r
299 <td>\r
300 \r
301 <!-- NextShare: Generate video code for FX or IE -->\r
302 <script type="text/javascript">\r
303 if (navigator.appName == "Netscape")\r
304 {\r
305         //\r
306         // FX: use HTML5 video tag and NextShare SwarmTransport\r
307         //\r
308         var posterurl = "http://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Yochai_Benkler_-_On_Autonomy%2C_Control_and_Cultureal_Experience.ogg/mid-Yochai_Benkler_-_On_Autonomy%2C_Control_and_Cultureal_Experience.ogg.jpg";\r
309         var videourl = "http://upload.wikimedia.org/wikipedia/commons/d/d6/Yochai_Benkler_-_On_Autonomy%2C_Control_and_Cultureal_Experience.ogg";  \r
310     writep2pvideotag(videourl,posterurl);\r
311 }\r
312 else\r
313 {\r
314         //\r
315         // IE8: Fallback to NextShare SwarmPlugin\r
316         //\r
317         writeplugin("vlc3","http://tracker1.p2p-next.org:6970/file?info_hash=%BCy%E5%B0%A8%0EK%E1i%00%82%94%7B%0FoH%3Dn%FAZ");\r
318 }\r
319 </script>\r
320 \r
321 </td>\r
322 <td><a href="http://en.wikipedia.org/wiki/Steal_This_Film">Steal This Film</a> \r
323 is a film series documenting the movement against intellectual property produced\r
324 by <a href="http://en.wikipedia.org/wiki/The_League_of_Noble_Peers">The League \r
325 of Noble Peers</a> and released via the \r
326 <a href="http://en.wikipedia.org/wiki/BitTorrent">BitTorrent</a> peer-to-peer \r
327 protocol. \r
328 </td>\r
329 \r
330 </tr>\r
331 \r
332 <!-- End of 2-column table of videos -->\r
333 </table>\r
334 \r
335 </tr>\r
336 \r
337 \r
338 \r
339 \r
340 <!-- Step 3 -->\r
341 <tr>\r
342   <td class="nr"><img src="images/03_120px.png"  height="120" lowsrc="images/03.png"></td>\r
343   <td><p class="title">Statistics</p>\r
344     <p class="text">Visit the <a href="http://tracker1.p2p-next.org:6970/">NextShare tracker</a> to see some statistics.</p>\r
345 </tr>\r
346 </table>\r
347 </td>\r
348 \r
349 \r
350 </tr>\r
351 </table>\r
352 <br>\r
353 <table class="footer">\r
354 <tr>\r
355   <td> Home |  <a href="legal.html">Legal</a> </td>\r
356 </tr>\r
357 </table>\r
358 </center>\r
359 </body>\r
360 </html>\r
361 \r