Youtube API: is there a way to know the internet c

2019-08-27 22:14发布

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?

标签: youtube-api
1条回答
相关推荐>>
2楼-- · 2019-08-27 22:39

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.

查看更多
登录 后发表回答