Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IP camera stream with UIWebview works on IOS 5 but not on IOS 6

Hi im streaming an ip camera on my website and I embed my website on a UIWebview , is working ok with IOS 5 but when i open my app on IOS 6 only shows a image and not the video. On my website im using <iframe width="640" height="480" src="http://112.214.96.41:87/videostream.cgi?user=user&pwd=" frameborder="0"></iframe> please somebody help me, there is another way?

like image 406
Sabino Diaz Avatar asked Sep 13 '12 18:09

Sabino Diaz


1 Answers

If you want to display an IP Camera inside a UIWebView, you can do this for example : (supposing the webView is an outlet to your UIWebView)

NSString * stream = @"http://login:password@ip:port/stream/"


NSString * html = [NSString stringWithFormat:@"<img name=\"Cam\" src=\"%@\" width=\"100%%\" height=\"100%%\" alt=\"Live Feed\" style=\"background-color: #000000\" />", stream];

[webView loadHTMLString:html baseURL:nil];

Where stream is the correct url, depending on the model of your camera.

It works on iOs5 and iOs6.

like image 106
Guillahume Avatar answered Oct 31 '22 18:10

Guillahume