www.webdeveloper.com
Results 1 to 2 of 2

Thread: poll in javascript

  1. #1
    Join Date
    Oct 2012
    Posts
    9

    poll in javascript

    I'm using youtube api to get to know when a video is fully buffered
    player.getVideoLoadedFraction()

    when the fraction is 1, the video is fully buffered
    but I have to poll this function to check whether it is 1 and then get the time
    like setInterval(display_fraction,1);
    since a video could be tens of minutes
    will this polling creates a heavy load on the browser/client and thus affect the video streaming? are there any other better polling methods or ways to detect when youtube finishes buffering?

    BTW, the link for youtube api is:
    https://developers.google.com/youtub...yback_controls

  2. #2
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    it can draw at 33fps and use 1/33rd resources by changing the 1 to a 33. 100 or even 500 would work as well. at 500, it would only run a few times, so that wont slow down cheap tablets like checking 1000 times a second would.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles