HTML5 video for iPhone / iPad. How to detect connection speed?

前端 未结 2 1297
梦谈多话
梦谈多话 2020-12-10 23:20

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 f

相关标签:
2条回答
  • 2020-12-10 23:44

    You will have to load some sort of document to test your connection speed.

    an example -- http://alexle.net/archives/257

    0 讨论(0)
  • 2020-12-10 23:53
    • I am assuming this will be in your own application:

    You could use Apple's Reachability to determine the connection type in your application before sending the UIWebView's request. You can modify the request's URL by adding a query:

    //determine the connection type via Reachability
    
    myURLString = [myURLString stringByAppendingString:[NSString stringWithFormat:@"?conntype=%@", *connTypeString]];
    
    //then send the request for the page.
    

    Then, parse the URL query in PHP to determine the video URL that should be used.

    • If not, you would need to test the connection speed via a third-party Javascript or PHP script.

    Example: http://jan.moesen.nu/code/php/speedtest/index.php?numKB=512

    0 讨论(0)
提交回复
热议问题