addStreamProxy支持透传参数并设置MediaPlayer (#3063)

通过addStreamProxy接口可以直接配置MediaPlayer相关设置参数,比如说http代理url等
This commit is contained in:
alexliyu7352
2023-12-01 14:33:07 +08:00
committed by GitHub
parent a8e2d602cb
commit 86029d08af
5 changed files with 234 additions and 101 deletions

View File

@@ -78,15 +78,16 @@ void HttpClient::sendRequest(const string &url) {
printer.pop_back();
_header.emplace("Cookie", printer);
}
if (isUsedProxy()) {
startConnect(_proxy_host, _proxy_port, _wait_header_ms / 1000.0f);
} else {
if (!alive() || host_changed) {
startConnect(host, port, _wait_header_ms / 1000.0f);
if (!alive() || host_changed) {
if (isUsedProxy()) {
_proxy_connected = false;
startConnect(_proxy_host, _proxy_port, _wait_header_ms / 1000.0f);
} else {
SockException ex;
onConnect_l(ex);
startConnect(host, port, _wait_header_ms / 1000.0f);
}
} else {
SockException ex;
onConnect_l(ex);
}
}