【问题标题】:IP camera stream with UIWebview works on IOS 5 but not on IOS 6带有 UIWebview 的 IP 摄像机流适用于 IOS 5 但不适用于 IOS 6
【发布时间】:2012-09-06 22:20:19
【问题描述】:
您好,我在我的网站上流式传输网络摄像机,并且我将我的网站嵌入到 UIWebview 上,在 IOS 5 上运行正常,但是当我在 IOS 6 上打开我的应用程序时,只显示图像而不是视频。
在我的网站上我使用<iframe width="640" height="480" src="http://112.214.96.41:87/videostream.cgi?user=user&pwd=" frameborder="0"></iframe>
请有人帮助我,还有其他方法吗?
【问题讨论】:
标签:
iphone
ios
ip
ipod
ios6
【解决方案1】:
如果您想在 UIWebView 中显示 IP 摄像机,您可以这样做,例如:
(假设 webView 是你的 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 是正确的 url,具体取决于您的相机型号。
它适用于 iOs5 和 iOs6。