开发者

How is youtube comments feature implemented?

开发者 https://www.devze.com 2023-02-21 12:22 出处:网络
How is youtube comments feature implemented? I see that they use AJAX but they don\'t do AJAX calls every second or two.Ajax call is made when there is a new comment on the video.

How is youtube comments feature implemented? I see that they use AJAX but they don't do AJAX calls every second or two.Ajax call is made when there is a new comment on the video. On my page I call a page every 5 seconds with AJAX. So how开发者_Python百科 are they doing that?


Personnally when i have a look at Firebug to see Ajax Request, i have one who's called every 2-3 seconds with parameters :

asv    3
ctp    2
docid      DbYtqAWDF2U
el     detailpage
et     20.087
fmt    34
ns     yt
plid       AASgAO8pqC5GDlo9
st     20.087
vid    VcyzE1TkaJrg4jlA8I_rWIK6z2TaXNB3R
yttk       1

docid is just the id of the video, $_GET['v'] var too.


It uses Ajax and if you see the content of the ajax call it contains poll_delay value which is something like 60,000 which means when it has to poll the live comments again.60 seconds in this case.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号