HTML5 video for iPhone / iPad. How to detect connection speed?
问题 I need to stream a video in Safari for iPhone/iPad with the best possible quality. I created 2 video files: one in low-quality for slow 3G speed, one in hi-quality for WiFi broadband streaming. I noticed that some apps (YouTube for example) are able to detect if the mobile device is running by 3G or WiFi, and so select a small sized video rather than an hi-quality video. Now that is my DOM / Javascript code, the $v value is replaced by PHP and contains the video filename: <video id="thevideo"