Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是不是 使用这个播放器就必须使用 你们的服务? #8

Open
drcayman opened this issue Aug 8, 2017 · 5 comments
Open

Comments

@drcayman
Copy link

drcayman commented Aug 8, 2017

No description provided.

@liyongming1982
Copy link
Contributor

liyongming1982 commented Aug 9, 2017

我们有开放API协议[http://openapi.webrtc.win],理论上贵司有足够人力开发后台API和调度,及部署CDN或者边缘节点的话,是可以不需要使用我们的服务,而直接集成PearPlayer对接你们自己的后台,享受PearPlayer先进算法带来的流畅体验。)

@liyongming1982
Copy link
Contributor

liyongming1982 commented Aug 9, 2017

如我们请求一个pear001.mp4文件:
url -X GET "http://api.webrtc.win/v1/customer/nodes?host=qq.webrtc.win&uri=tv%2Fpear001.mp4&client_ip=192.168.1.1" -H "accept: application/json" -H "X-Pear-Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZWFyIjoicGVhci1yZXN0ZnVsLWFwaS0zMzQ0IiwiZXhwIjoxNTAyMzIwODgwLCJqdGkiOiIxODMuNjAuNDAuMTA0OjI2MzMwIiwiaXNzIjoiZm9nLWxvZ2luLWFwaSIsInN1YiI6InN0cmluZyJ9.s9adE8-d1H2CxspXhXscCsAfw-vQgs_rWQ1ioDUDZuw"
`
随机返回N个节点
{
"nodes": [
{
"protocol": "https",
"host": "000c29d049f4.webrtc.win:17257",
"type": "node"
},
{
"protocol": "https",
"host": "000c29f0fa1c.webrtc.win:27997",
"type": "node"
},
{
"protocol": "webtorrent",
"magnet_uri": "magnet:?xt=urn:btih:1e02d0db405a5a17d59a2e1d42e9908f074a1e44&dn=pear001.mp4&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com"
}
]
}

@millken
Copy link

millken commented Apr 12, 2018

@liyongming1982 这里的N个节点,是要预先cache MP4文件吗?如果是的话,是不是所有节点都要cache这个文件,才能确保后面随机获得的节点是有内容可以提取的。
随机返回会不会选中链路不好的节点,这里应该是有一定算法保证所选节点的是最优的吧?

@liyongming1982
Copy link
Contributor

@millken
1 需要cache (根据文件的热度,有我们自己算法cache n份),不会在所有节点cache
2 返回的点不是随机的,根据你的IP,调度同一个AS域,运营商,甚至同一个局域网的节点给你

@millken
Copy link

millken commented Apr 12, 2018

@liyongming1982
谢谢回复!

  1. 如果这N份server了几个很大文件了,随着热度的降低,该文件会怎么处理?

  2. 假设N中有1/3的节点都down了,会重新在其他节点生成cache吗?恢复了又如何处理?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants