Youtube如何控制Flash内容加载(Chrome 12)
几天前,我的 Google Chrome 更新至 12.0.742.53 beta,我注意到非常有趣的变化。
打开Youtube视频页面时,即使所有内容(文本、图像)加载完毕,页面加载过程也不会结束;仅当视频缓冲完成时加载才会结束!另外,当我中断加载(例如按 Esc
)时,视频下载也会停止! (到目前为止,我必须右键单击视频并按停止下载才能中止缓冲)。
恕我直言,这是一种很棒的用户体验,也是使基于 Flash 的内容像普通 Web 内容一样运行的一大进步。
我的问题是:这是如何做到的?
我认为他们正在模拟一些加载过程,直到缓冲完成。此外,他们还应该处理 window.onAbort
事件或其他事件,以便“告诉”Flash 停止缓冲。我尝试使用 Chrome 的 DOM Inspector 捕获该事件,但没有运气...
或者...他们是否使用了一些目前仅在 Chrome 中可用的特殊 API?目前 FF4 上没有这样的行为。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是因为 Flash 的网络连接是通过浏览器处理的,因此 Flash 发出的请求会像任何其他请求一样被处理。
It's because flash's net connections are handled via the browser, so requests Flash makes are treated like any other request.