GSYVideoPlayer 可以播放rtsp 但是看Github 没有找到具体怎么配置播放的。
GSYVideoPlayer:https://github.com/CarGuo/GSYVideoPlayer
这里总结下
1、导入依赖包
//基础包
implementation 'com.shuyu:gsyVideoPlayer-java:7.1.4'
//是否需要ExoPlayer模式
implementation 'com.shuyu:GSYVideoPlayer-exo2:7.1.4'
//更多ijk的编码支持
implementation 'com.shuyu:gsyVideoPlayer-ex_so:7.1.4'
其中 gsyVideoPlayer-ex_so 是播放 rtsp的。一定得有才行。不让会报错 Protocol not found 等。
2、 xml中主要播放控件
<com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
android:id="@+id/videoPlayer"
android:layout_width="match_parent"
android:layout_height="250dp"
android:src="@drawable/meinv" />
activity中播放设置
@BindView(R.id.videoPlayer)
StandardGSYVideoPlayer videoPlayer;
OrientationUtils orientationUtils;
private void startVideo() {
videoPlayer.setUp(url, true, "测试视频");
VideoOptionModel videoOpti

本文详细介绍了如何使用GSYVideoPlayer在Android设备上播放RTSP流,包括依赖包导入、XML布局配置、播放设置及参数优化,确保流畅播放。

6136

被折叠的 条评论
为什么被折叠?



