c09c75cf00f8d484b13ae71f09d9a49672e88c2f
[xynt.git] / web / test-hs.php
1 <html>
2 <head>
3 <script type="text/javascript" src="xynt/xynt-commons.js"></script>
4 <script type="text/javascript" src="xynt/xynt-console.js"></script>
5 <script type="text/javascript" src="xynt/xynt-http-streaming.js"></script>
6 <script type="text/javascript"><!--
7 var gst = null;
8
9 <?php
10     if ($action != 'stop') {
11 ?>
12 window.onload = function () {
13     var hs;
14     var sess;
15
16     sess = '<?php
17     if (!isset($sess)) {
18         $sess = md5(mt_rand());
19     }
20     printf("%s", $sess);
21 ?>';
22     
23     createCookie('sess', sess, 24*365,cookiepath);
24     gst = new globst();
25     hs = new http_streaming(window, gst, sess, console);
26     // FIXME: with relative path not work!
27     hs.start('http://dodo.birds.lan/xynt/test-hs-rd.php');
28     // hs.start('test-hs-rd.php');
29 };
30 <?php
31     }
32 ?>
33
34 window.onkeypress = function () {
35     console.log("win kpress");
36 }
37 //-->
38 </script>
39 <body onabort = "console.log('abort');" onunload = "console.log('unload');" onerror = "console.log('error');" onkeypress = "console.log('keypress');">
40 <div id="cont">INIT</div>
41 <?php
42     if ($action != 'stop') {
43 ?>
44     <a href="test-hs.php?action=stop">STOP</a>
45 <?php
46     } else {
47 ?>
48     <a href="test-hs.php?action=start">START</a>
49 <?php
50     }
51 ?>
52
53 </body>
54 </html>