小智 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.
| 归档时间: |
|
| 查看次数: |
5003 次 |
| 最近记录: |