调整播放器

This commit is contained in:
2023-01-09 20:30:34 +08:00
parent 7070f5c1b4
commit ee6a4288b0
4 changed files with 64 additions and 5 deletions

View File

@@ -244,7 +244,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
@Override
public void setLiveEnterRoomNewModel(EnterRoomNewModel data) {
super.setLiveEnterRoomNewModel(data);
mPlayer.clearFrame();
isPk=data.getEnterRoomInfo().getIsconnection().equals("1");
}
/**
@@ -283,9 +283,9 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
if (playModel != PLAY_MODEL_DEF && !url.contains(videoFps[0] + ".flv")) {
mPlayer.setViewResizeMode(landscape == VIDEO_VERTICAL);
if (landscape == VIDEO_VERTICAL) {
url = url.replace(".flv", videoRatioVertical[playModel] + videoFps[0] + ".flv");
waitNextUrl = url.replace(".flv", videoRatioVertical[playModel] + videoFps[0] + ".flv");
} else if (landscape == VIDEO_HORIZONTAL) {
url = url.replace(".flv", videoRatioHorizontal[playModel] + videoFps[0] + ".flv");
waitNextUrl = url.replace(".flv", videoRatioHorizontal[playModel] + videoFps[0] + ".flv");
}
} else if (!url.contains(videoFps[0] + ".flv")) {
mPlayer.setViewResizeMode(false);
@@ -311,7 +311,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
public void switchStream(String url, int playModel) {
srcUrl = url;
PLAY_MODEL = playModel;
Log.i(TAG, "switchStream: " + " url:" + url + " playModel: " + playModel + " landscape: " + landscape + " videoLandscape = " + videoLandscape);
Log.i(TAG, "switchStream: " + " url:" + url + " playModel: " + playModel + " landscape: " + landscape + " videoLandscape = " + videoLandscape + " ispk = " + isPk+" bean = "+roomModel.getEnterRoomInfo().getIsconnection());
if (playModel != PLAY_MODEL_DEF && !url.contains(videoFps[0] + ".flv")) {
mPlayer.setViewResizeMode(landscape == VIDEO_VERTICAL);
if (landscape == VIDEO_VERTICAL && !isPk) {
@@ -487,6 +487,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
public void setPkview() {
Log.i("收到socket--->", "变成169");
String url = srcUrl;
isPk = true;
switchStreamPk(true);
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
params.height = vHeight;