具有UIWebview的IP摄像机流适用于IOS 5,但不适用于IOS 6 [英] IP camera stream with UIWebview works on IOS 5 but not on IOS 6
问题描述
嗨我在我的网站上流式传输ip相机并将我的网站嵌入到UIWebview中,与IOS 5一起工作正常但是当我在IOS 6上打开我的应用程序时只显示图像而不是视频。
在我的网站上使用< iframe width =640height =480src =http://112.214.96.41:87/videostream.cgi?user=user&pwd =frameborder =0>< / iframe>
请有人帮助我,有另一种方法吗?
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?
推荐答案
如果要在UIWebView中显示IP摄像头,可以这样做:
(假设webView是UIWebView的插座)
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];
其中stream是正确的网址,具体取决于相机的型号。
Where stream is the correct url, depending on the model of your camera.
适用于iOs5和iOs6。
It works on iOs5 and iOs6.
这篇关于具有UIWebview的IP摄像机流适用于IOS 5,但不适用于IOS 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!