具有UIWebview的IP摄像机流适用于IOS 5,但不适用于IOS 6

Sab*_*iaz 7 iphone ip ipod ios ios6

嗨我在我的网站上流式传输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> 请有人帮助我,有另一种方式吗?

小智 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];
Run Code Online (Sandbox Code Playgroud)

其中stream是正确的url,具体取决于相机的型号.

它适用于iOs5和iOs6.