Use only Javascript, I haven’t tested it:
<html>
<head>
</head>
<body>
<div>
<object width="100%" height="100%" id="liveTV_api" name="liveTV_api"
data="http://www.extratv.gr/media/imgs/flowplayer-3.2.15.swf" type="application/x-shockwave-flash"><param
name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="quality"
value="high"><param name="bgcolor" value="#000000"><param name="flashvars" value="config={"clip":{"url":"mpegts_256.stream","provider":"rtmp","live":true,"scaling":"fit"},"plugins":{"rtmp":{"url":"http://www.extratv.gr/media/imgs/flowplayer.rtmp-3.2.11.swf","netConnectionUrl":"rtmp://213.16.167.186:1935/live","subscribe":true}},"playerId":"liveTV","playlist":[{"url":"mpegts_256.stream","provider":"rtmp","live":true,"scaling":"fit"}]}"></object>
<img id="adtv" src="https://stackoverflow.com/questions/26488622/img.png">
</div>
<script type="text/javascript">
function update() {
var now = (new Date()).getHours(),
start = 12,
end = 13;
if(now >= start && now <= end) {
document.getElementById("adtv").style.display="none";
document.getElementById("liveTV_api").style.display="block";
}
else {
document.getElementById("adtv").style.display="block";
document.getElementById("liveTV_api").style.display="none";
}
}
// repeat interval in milliseconds
window.setInterval(update, 3600000);
update();
</script>
</body>
</html>
solved javascript inside an eternal loop php code doesnt work [closed]