Is there any way to check if a Motion JPEG stream is on/working/sending images using JavaScript or jQuery?
Asked
Active
Viewed 2,340 times
3
-
What do you want to check for? Just display? http://stackoverflow.com/questions/5269376/cross-browser-solution-for-displaying-mjpeg-stream – VDP Sep 07 '12 at 07:11
-
you can check if it gets loaded or not... Don't think there are much other events to listen to... `$output = $('
').attr('src', src).load(function(){alert('ok')}).error(function(){alert('error')});` – VDP Sep 07 '12 at 07:20
-
@VDP ReferenceError: src is not defined – Andresh Podzimovsky Sep 07 '12 at 07:25
-
lol! you have to define it `var src = 'your url'` also you have to append the `$output` to the dom if you want to see it :) This snippet is creating a new img tag adding a src and adding an onload and onerror callback that's all :) – VDP Sep 07 '12 at 07:29
-
@VDP image is already streaming - i only need to check if it's ok. – Andresh Podzimovsky Sep 07 '12 at 07:32