How does Youtube control Flash content loading (Chrome 12)

非 Y 不嫁゛ 提交于 2020-01-16 00:50:09

问题


Several days ago my Google Chrome was updated to 12.0.742.53 beta, and I've noticed very interesting change.
When opening a Youtube video page, page loading process does not end even when all the content (text, images) is loaded; loading ends only when video buffering completes! Also, when I interrupt the loading (by pressing Esc, for example) video downloading is also stopped! (Until now I had to right click on the video and press Stop Download to abort buffering).

IMHO that's a great user experience and a big step for making the Flash-based content behave like ordinary web content.

My question is: how this is done?!

I thought they're simulating some loading process until the buffering completes. Also they should have handled the window.onAbort event or something, in order to "tell" the Flash to stop buffering. I tried to catch that event using Chrome's DOM Inspector, but no luck...

Or... do they use some special API that is currently available only in Chrome? There is no such behavior on FF4 right now.


回答1:


It's because flash's net connections are handled via the browser, so requests Flash makes are treated like any other request.



来源:https://stackoverflow.com/questions/6015496/how-does-youtube-control-flash-content-loading-chrome-12

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!