Not-wifi connection with phone detection check

568 views Asked by At

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.

1

There are 1 answers

0
Frederik.L On

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.