request mjpeg file
how do I make a request for a MJPEG file to a IP Camera?
3 Answers
-
I am having the same issue, however to be more clear (and to help out @ale ale)
in my index.html page i have a standard img tag, its source is outside of the project:
<img src="http://192.168.1.100/mjpg/video.mjpg" alt="" />The application A) does not know how to display a Motion-JPEG, and B)the debug window is trying to Proxy it
[22:31:07:638] [Titanium.Proxy] [Debug] Looking up proxy info…
[22:31:07:651] [Titanium.Proxy] [Debug] Proxy auto config activated by…
[22:31:07:656] [Titanium.Proxy] [Debug] Checking whether http://192.168.1.100/mjpg/video.mjpg should be bypassed.
[22:31:07:656] [Titanium.Proxy] [Debug] No bypassso really what I need to see answered is why does the compiled app not understand how to display a Motion-JPEG?
Thanks,
Chris -
Use a webView:
Here's a demo of a live MJPG stream.
var win = Ti.UI.currentWindow; win.backgroundColor = '#555'; var mjpeg_source = 'http://webcam.mum.edu/cgi-bin/video320x240.mjpg'; var playerHTML = '<html><body style="background:#000;padding:0px;margin:0px;"><img width="320" height="240" src="'+mjpeg_source+'"></body></html>'; var mjpeg_webview = Titanium.UI.createWebView({ html: playerHTML, width:320, height:240, top:10 }); win.add(mjpeg_webview);
-
You can use:
exports.create = function(mjpgurl) { var self = Titanium.UI.createWebView({ url:mjpgurl, width:320, height:240 }); Ti.App.addEventListener('resume',function(){self.reload}); return self; }