调整播放器拉升问题4

This commit is contained in:
zlzw 2023-01-09 15:26:43 +08:00
parent 207811c41d
commit 93e2a8af02

View File

@ -111,6 +111,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
static int vHeight;//视频高
private TextView debugView;
private LiveExoPlayerManager mPlayer;
private boolean isPk = false;
//0未申请1申请中2连麦中
RCRTCRoom rcrtcRoom;
@ -286,7 +287,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
} else if (landscape == VIDEO_HORIZONTAL) {
url = url.replace(".flv", videoRatioHorizontal[playModel] + videoFps[0] + ".flv");
}
} else if(!url.contains(videoFps[0] + ".flv")){
} else if (!url.contains(videoFps[0] + ".flv")) {
mPlayer.setViewResizeMode(false);
}
Log.e("purl121", url);
@ -318,7 +319,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
} else if (landscape == VIDEO_HORIZONTAL) {
url = url.replace(".flv", videoRatioHorizontal[playModel] + videoFps[0] + ".flv");
}
} else if(!url.contains(videoFps[0] + ".flv")){
} else if (!url.contains(videoFps[0] + ".flv")) {
mPlayer.setViewResizeMode(false);
}
Log.e("purl121", url);
@ -335,13 +336,23 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
purl = url;
}
boolean tmpPk = false;
@Override
public void switchStreamPk(boolean isPk) {
super.switchStreamPk(isPk);
if (isPk && !srcUrl.contains(videoFps[0] + ".flv")) {
if (isPk && !srcUrl.contains(videoFps[0] + ".flv") && !tmpPk) {
tmpPk = true;
mPlayer.setViewResizeMode(false);
String url = srcUrl.replace(".flv", videoRatioHorizontal[PLAY_MODEL] + videoFps[0] + ".flv");
switchStream(url,PLAY_MODEL);
String url;
if (PLAY_MODEL != -1) {
url = srcUrl.replace(".flv", videoRatioHorizontal[PLAY_MODEL] + videoFps[0] + ".flv");
} else {
url = srcUrl.replace(".flv", videoRatioHorizontal[1] + videoFps[0] + ".flv");
}
mPlayer.switchUrl(url);
} else if (!isPk) {
tmpPk = false;
}
}
@ -464,6 +475,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
if (PLAY_MODEL != -1) {
url = url.replace(".flv", videoRatioHorizontal[PLAY_MODEL] + videoFps[0] + ".flv");
}
isPk = true;
mPlayer.setViewResizeMode(false);
mPlayer.switchUrl(url);
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
@ -477,7 +489,8 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
public synchronized void setPkEndview() {
Log.i("收收收", landscape + "");
isPk = false;
tmpPk = false;
if (landscape == 2) {
Log.i("收到socket--->", "还原916");
String url = srcUrl;