more readable log, start/stop button added, many body related events traced
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.com>
Tue, 17 Apr 2012 05:17:42 +0000 (07:17 +0200)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.com>
Tue, 17 Apr 2012 05:17:42 +0000 (07:17 +0200)
web/test-hs-rd.php
web/test-hs.php
web/xynt/xynt-http-streaming.js

index 27146b4..4f13f24 100644 (file)
@@ -9,7 +9,7 @@ var ctx_new = "";
 window.onload = function () { if (http_streaming != "ready") http_streaming.reload(); };
 </script> 
 </head>
-<body>
+<body onabort = "console.log('rd abort');" onunload = "console.log('rd unload');" onerror = "console.log('rd error');" onkeypress = "console.log('rd keypress');">
 </body>
 <?php
 function mop_flush()
@@ -28,10 +28,10 @@ function main()
         // if ($i == 0)
         //    sleep(1);
      
-        if ($i != 8) {
+        if ($i != 8 || true) {
             printf("<script id='hs%d' type='text/javascript'>
-push(\"$('cont').innerHTML = '%d';\");
-</script>", $i, $i);
+push(\"$('cont').innerHTML += '%s %d';\");
+</script>", $i, ($i == 0 ? "<br/>" : ""), $i);
         }
         else {
             // exit();
index 6804a99..3ffd263 100644 (file)
@@ -6,16 +6,40 @@
 <script type="text/javascript"><!--
 var allmythings="BEGIN";
 
+<?php
+    if ($action != 'stop') {
+?>
 window.onload = function () {
     var hs;
     hs = new http_streaming(window, console);
     // FIXME: with relative path not work!
     hs.start('http://dodo.birds.lan/xynt/test-hs-rd.php');
+    // hs.start('test-hs-rd.php');
+};
+<?php
+    }
+?>
+
+
+
+window.onkeypress = function () {
+    console.log("win kpress");
 }
-    
 //-->
 </script>
-<body>
+<body onabort = "console.log('abort');" onunload = "console.log('unload');" onerror = "console.log('error');" onkeypress = "console.log('keypress');">
 <div id="cont">INIT</div>
+<?php
+    if ($action != 'stop') {
+?>
+    <a href="test-hs.php?action=stop">STOP</a>
+<?php
+    } else {
+?>
+    <a href="test-hs.php?action=start">START</a>
+<?php
+    }
+?>
+
 </body>
 </html>
index d671d8f..7efb2f5 100644 (file)
@@ -197,6 +197,8 @@ http_streaming.prototype = {
     },
 
     abort: function () {
+        // this.log("PATH: "+this.ifra.contentWindow.location.protocol + "://" + this.ifra.contentWindow.location.host + "/" + this.ifra.contentWindow.location.pathname);
+
         this.gst.abort();
         if (this.watchdog_hdl != null) {
             clearTimeout(this.watchdog_hdl);