我试图开发一个应用程序来加载 Youtube 视频,但我想在它完全可用时播放它,但是我无法在 API 文档 和 演示页面。
但是,在演示页面上,它更新了以下内容:
Total bytes: 14316401
Start bytes: 0
Bytes loaded: 14316401
但是,我不知道最好的方法是什么。您能否建议我一种在视频完全加载时获得回调的正确且稳定的方法,或者如果我错了可以修复我?
I was trying to develop an application where I would load a Youtube video, but I want to play it when it is fully available, however I could not find a proper callback in the API Documentation and on the Demo Page.
However, on the Demo page, it updates the following:
Total bytes: 14316401
Start bytes: 0
Bytes loaded: 14316401
But, I do not know what is the best approach to that. Can you suggest me a proper and stable way of getting a callback when the video is fully loaded or fix me on if I am wrong?
发布评论
评论(1)
似乎没有人关心,所以我决定在 1/2 秒的时间内检查比率(下载的字节数/总字节数)。
Seems no one cared, so I decided to go with checking the ratio(downloaded bytes/total bytes) in a 1/2 sec period.