JPG-Stream mit Javascript einbinden

Begonnen von Sailor, 21 April 2017, 11:20:01

Vorheriges Thema - Nächstes Thema

Sailor

Hallo Andreas

Zitat von: EdlerMann am 24 Mai 2017, 12:26:16
hast du es mittlerweile hinbekommen? Ich habe momentan leider das selbe Problem... .

Nein, leider noch nicht. Irgendwie aktzeptiert "weblink" nicht alles was eine normale Webseite aktzeptiert.
Zur Zeit bekomme ich nur ein snapshot zum Zeitpunkt des Browser-refreshs angezeigt.

Es ist zum Verzweifeln.

Gruß
    Sailor
******************************
Man wird immer besser...

Sailor

Moin zusammen.

Ich bin einen einen kleinen Schritt weiter:

Der Code


htmlCode
<script language="javascript">
var img = new Image();
var imgObj; function preload()
{
img.src='http://192.168.178.21/tmpfs/auto.jpg?'+new Date;
}
function changesrc()
{
img1.src=img.src; preload();
setTimeout(changesrc,3500);
}
function update()
{
imgObj = document.getElementById('img1');
imgObj.src = img.src;
img.src = "http://192.168.178.21/tmpfs/auto.jpg?" + (new Date()).getTime();
}
function takeError()
{
img.src = "http://192.168.178.21/tmpfs/auto.jpg?" + (new Date()).getTime();
}
function startonload()
{
img.src = "http://192.168.178.21/tmpfs/auto.jpg?" + (new Date()).getTime();
img.onerror=takeError;
img.onload=update;
}
function load()
{
if (navigator.appName.indexOf("Microsoft IE Mobile") != -1)
{
preload();
changesrc();
return;
}
startonload();
}
</script>
<body onLoad="load()">
<img id="img1" border="0" src="http://192.168.178.21/tmpfs/auto.jpg">
</body>


läuft zwar nach wie vor nicht unter Win10/Firefox 53.0.3 aber er läuft unter Android/Firefox 53.0.2.

Das verstehe doch wer will!

Gruß
   Sailor
******************************
Man wird immer besser...