简体   繁体   中英

Not-wifi connection with phone detection check

How can I check on the web if someone is visiting a page with a 3G mobile connection (so no WiFi)? This because I want to show a video when someone has a normaal speed internet connection on his phone (with WiFi). If someone has a slow (not WiFi) internet connection on his phone at that moment, I want to show a photo instead. So the user doesn't have to download the 30MB video file with his try connection, and destroying his bandwidth limit of his provider. I prefer a client-side solution with jQuery/Javascript or server-based with PHP if possible.

Found an interesting approach to estimate the connection speed with PHP : http://www.emanueleferonato.com/2006/05/31/determine-connection-speed-with-php/

The estimated speed will depend on the connectivity with the server so it is not so accurate but may give you a great idea. You could display the photo whenever the result is lower than a certain value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM