X-Git-Url: https://mop.ddnsfree.com/gitweb/?p=xynt.git;a=blobdiff_plain;f=web%2Fxynt%2Fxynt-http-streaming.js;fp=web%2Fxynt%2Fxynt-http-streaming.js;h=cd31eadece161ba932884c5576a3a898bb446b54;hp=0000000000000000000000000000000000000000;hb=865cb740c39d77fdb20de3a9964be205491bee21;hpb=881baf47a6bc1a065a8e314b8a9e1a304d731775 diff --git a/web/xynt/xynt-http-streaming.js b/web/xynt/xynt-http-streaming.js new file mode 100644 index 0000000..cd31ead --- /dev/null +++ b/web/xynt/xynt-http-streaming.js @@ -0,0 +1,50 @@ +function http_streaming(doc) +{ + this.doc = doc; + this.keepalive_old = -1; + this.keepalive_new = -1; + this.keepalives_equal = 0; + this.ifra = doc.createElement("iframe"); + this.ifra.style.visibility = "hidden"; + doc.body.appendChild(this.ifra); + // this.ifra.contentWindow.onload = function () { + // this.ifra.contentWindow.location.href = 'winstream_rdxxx.php'; + // } + +} + +http_streaming.prototype = { + doc: null, + ifra: null, + keepalive_old: -1, + keepalive_new: -1, + keepalives_equal: 0, + keepalives_eq_max: 6, + + start: function(page) { + this.ifra.contentWindow.location.href = page; + }, + + watchdog: function () { + /* +this.keepalives_equal */ + console.log("watchdog "); + if (this.keepalive_old == this.keepalive_new) { + this.keepalives_equal++; + } + else { + this.keepalives_equal = 0; + } + + if (this.keepalives_equal > this.keepalives_eq_max) { + console.log("MAX ACHIEVED "+this.keepalives_equal); + } + else { + setTimeout(function(obj) { obj.watchdog() }, 2000, this); + } + }, + + keepalive: function () { + this.keepalive_new++; + } + +} \ No newline at end of file