问题
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