- 一.github地址
- 二.代码
- 0.快手官网获得直播地址
- 1.xml布局
- 2.java代码
https://github.com/CarGuo/GSYVideoPlayer
二.代码 0.快手官网获得直播地址https://live.kuaishou.com
1.xml布局2.java代码
public class ZhiBoActivity extends AppCompatActivity { private GSYVideoPlayer gsyVideoPlayer; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_zhi_bo); gsyVideoPlayer = findViewById(R.id.gsy); //客户端启动 gsyVideoPlayer.onVideoResume(); //设置进行全屏播放 // GSYVideoType.setShowType(GSYVideoType.SCREEN_TYPE_CUSTOM); //设置URL gsyVideoPlayer.setUp("https://tx-adaptive.pull.yximgs.com/gifshow/2YH0jtzY7ZQ.flv?txSecret=9f7ecab9699292d8e41eff90b45dacdf&txTime=62f3689f&stat=3e%2FMqmuA1li8krumyImlBq5j5q8pn7LxE8eVZjmHclCIuRrCx44GfC5wQnktMZ9l&oidc=watchmen&sidc=5907&fd=1&ss=s20&kabr_spts=-5000https://tx-adaptive.pull.yximgs.com/gifshow/2YH0jtzY7ZQ.flv?txSecret=9f7ecab9699292d8e41eff90b45dacdf&txTime=62f3689f&stat=3e%2FMqmuA1li8krumyImlBq5j5q8pn7LxE8eVZjmHclCIuRrCx44GfC5wQnktMZ9l&oidc=watchmen&sidc=5907&fd=1&ss=s20&kabr_spts=-5000",false,"直播"); //播放 gsyVideoPlayer.startPlayLogic(); } }