嗨我在我的网站上流式传输ip相机并将我的网站嵌入到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>
请有人帮助我,有另一种方法吗?
答案 0 :(得分:9)
如果要在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是正确的网址,具体取决于相机的型号。
适用于iOs5和iOs6。