How to enable android4.0 to view streaming media through proxy

Source: Internet
Author: User

In the era of android3.x, the title does not exist. But by 4.0, I don't know why all android arm versions use the V8 engine by default using the Chrome browser. During the test of CTS, we found that if you use a proxy to access the Internet (because the test items in CTS often need to access the Internet such as YouTube, you need to flip the wall to browse), you cannot play YouTube videos, apart from opening some videos because they cannot be played due to format problems, android4.0's own design defects account for a large proportion. Because 4.0 uses the non-proxy parser creation method when creating the proxy service, the media cannot use the proxy during playback.
Network. Of course, this can be said that Google's design is not good. After all, in most regions outside the tianchao dynasty, There is no wall flip, if Google engineers are asked to consider the special circumstances of tianchao during design, it is really difficult.

No way, you can only change the code for the product through CTS. First, add the following in frameworks/base/Media/libstagefright/chromium_http/support. cpp sfrequestcontext:

Property_get ("net. Proxy. hostname", proxy_name ,"");
STD: String host_name = proxy_name;
If (host_name.length ()> 0 ){
Set_proxy_service (net: proxyservice: createfixed (host_name ));
}
Else {
Set_proxy_service (net: proxyservice: createwithoutproxyresolver (
New net: proxyconfigserviceandroid, net_log ()));
}

Add systemproperties. Set ("net. Proxy. hostname", host) in packages/apps/settings/src/COM/Android/settings/WiFi/wificonfigcontroller. Java 416 );

This is a little worse, because every time you restart the machine, Android will automatically judge the network connection status in the wifiservice before the restart, and re-connect. That is to say, the settings will not be taken away at this time, and after media restarts, it will re-create proxy_service to open the webpage, then the createwithoutproxyresolver method will be used at this time, in CTS, it is common to restart the machine. Therefore, you need to make some modifications in the WiFi state machine:

Is to send the net again after the connection is successful. proxy. the environment variable of hostname. As for where to send this message, I personally think that it can be sent within this period of time after the state machine enters connectsuccess and before the media set_proxy_service.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.