Youtube API:有没有办法知道用户使用 api 的互联网连接速度 [英] Youtube API: is there a way to know the internet connection speed of user using api
问题描述
1) 有没有办法使用 youtube api 找出用户的网速2)有没有办法使用youtube api找出有多少缓冲被遗漏或完成或不使用.
如果 youtube api 不支持,还有其他方法吗?
1) 我不认为 API 提供了这一点.这里有一个例子:如何在 Javascript 中检测互联网速度?
2) 查看 docs 以了解 JavaScript Player API:><块引用>
player.getVideoLoadedFraction():Float
返回一个介于 0 和 1 之间的数字,指定百分比播放器显示为缓冲的视频.此方法返回更多比现在已弃用的 getVideoBytesLoaded 和getVideoBytesTotal 方法.
1)is there a way to find out the user's net speed using youtube api 2)is there a way to find out how much buffering is left out or is complete or not using youtube api.
if not supported by youtube api, is there any other way?
1) I don't think the API provides this. There's an example here: How to detect internet speed in Javascript?
2) Check the docs for the JavaScript Player API:
player.getVideoLoadedFraction():Float
Returns a number between 0 and 1 that specifies the percentage of the video that the player shows as buffered. This method returns a more reliable number than the now-deprecated getVideoBytesLoaded and getVideoBytesTotal methods.
这篇关于Youtube API:有没有办法知道用户使用 api 的互联网连接速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!