兩個rtsp流,設為rtsp1,rtsp2:
1. 使用前判斷rtsp1,是否可用.如果不可用就用rtsp2,反之用rtsp1.
求判斷的方法,急.
1. 使用前判斷rtsp1,是否可用.如果不可用就用rtsp2,反之用rtsp1.
求判斷的方法,急.
解决方案 »
- 又来发问了,我怎么解析从服务器传过来的字符串?内容是xml,也就是解析xml
- android ui
- NDK环境编译提示找不到 AttachCurrentThread
- 提问一下gluPerspective模型下,顶点坐标于屏幕坐标如何对应的问题.
- 求助:Re-installation failed due to different application signatures
- java解压zip文件问题
- socket的问题
- 请教高手android中使用JSON的问题
- 加Android源代码到eclipse,出现ParameterInfo.java could not be read错误
- 淘宝订单有没有接口进行支付的?
- 基于Android的通讯录设计
- 手机休眠状态下,alarmmanager不准的问题
$url = "http://203.90.252.78:8086/connectioncounts";
$user = "***";
$pass = "***";
echo curl_apply_userpwd($url, $user, $pass);
/* # Get the page with userpwd
* $url->page url,
* $user->user name,
* $pass->password
*/
function curl_apply_userpwd($url, $user, $pass) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_USERPWD, $user.":".$pass);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$return = curl_exec($ch);
if (!$return) {
$error = url_error($ch);
curl_close($ch);
return $error;
}else {
curl_close($ch);
return $return;
}
}
以php模擬登入獲得流的服務器信息,就很容易判斷了