layout | title |
---|---|
page |
پخش زنده |
لطفا صبور باشید...
<script>
var status_url = 'http://server.mehsen.ir/status-json.xsl';
function ajax_get(url, callback) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
try {
var data = JSON.parse(xmlhttp.responseText);
} catch(err) {
console.log(err.message + " in " + xmlhttp.responseText);
return;
}
callback(data);
}
};
if ("withCredentials" in xmlhttp) {
xmlhttp.open("GET", url, true);
} else if (typeof XDomainRequest != "undefined") {
xmlhttp = new XDomainRequest();
xmlhttp.open("GET", url);
} else {
throw new Error('CORS not supported');
}
xmlhttp.send();
}
String.prototype.toFaDigit = function() {
return this.replace(/\d+/g, function(digit) {
var ret = '';
for (var i = 0, len = digit.length; i < len; i++) {
ret += String.fromCharCode(digit.charCodeAt(i) + 1728);
}
return ret;
});
};
ajax_get(status_url, function(data) {
if (data["icestats"]["source"]) {
var started_milis_ago = Date.now() - Date.parse(data["icestats"]["source"]["stream_start_iso8601"]);
var html = "" + "در حال پخش زنده!" + "
"; html += '