From d4549793d115ab3e2cee27977a682e32635b3d65 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Fri, 18 Aug 2023 14:48:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A4=B4=E5=83=8F=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/utils/LiveExoPlayerManager.java | 5 ++++- .../java/com/yunbao/live/views/LivePlayRyViewHolder.java | 2 ++ .../com/yunbao/main/activity/EditProfileActivity.java | 9 ++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java b/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java index 3fb0791c9..b497b30d3 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java @@ -4,7 +4,6 @@ import android.content.Context; import android.os.Handler; import android.os.Looper; import android.util.Log; -import android.view.ViewGroup; import android.widget.RelativeLayout; import androidx.annotation.NonNull; @@ -130,6 +129,7 @@ public class LiveExoPlayerManager { @Override public void onPlaybackStateChanged(int playbackState) { Player.Listener.super.onPlaybackStateChanged(playbackState); + listener.onPlaybackStateChanged(playbackState); Log.i(TAG, "onPlaybackStateChanged 1: " + playbackState); if (playbackState == Player.STATE_READY && !player1.isPlaying()) { player2.stop(); @@ -188,6 +188,9 @@ public class LiveExoPlayerManager { public void onIsLoadingChanged(boolean isLoading) { Player.Listener.super.onIsLoadingChanged(isLoading); Log.i(TAG, "onIsLoadingChanged: 1 " + isLoading); + if (listener != null) { + listener.onIsLoadingChanged(isLoading); + } } @Override diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index 2c35ffe49..ec5cf1155 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -1243,9 +1243,11 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { Player.Listener.super.onPlaybackStateChanged(playbackState); if (playbackState == Player.STATE_BUFFERING) { //showLoadingDialog(); + //mLoading.setVisibility(View.VISIBLE); OkDownload.getInstance().pauseAll(); Log.i(TAG, "onPlaybackStateChanged: 缓存中"); } else { + //mLoading.setVisibility(View.INVISIBLE); Log.i(TAG, "onPlaybackStateChanged: 播放中"); } } diff --git a/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java b/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java index cad0cae1b..5c3e6335c 100644 --- a/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java @@ -128,10 +128,12 @@ public class EditProfileActivity extends AbsActivity { @Override public void onSuccess(File file) { if (file != null) { + System.err.println("头像---->收到头像文件 file = "+file.getAbsolutePath()+" | length = "+file.length()); ImgLoader.display(mContext, file, mAvatar); MainHttpUtil.updateAvatar(file, new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { + System.err.println("头像---->上传头像文件成功"); Log.e("updateAvatar", "code:" + code + " msg:" + msg + " info[0]:" + info[0].toString()); if (code == 0 && info.length > 0) { ToastUtil.show(R.string.edit_profile_update_avatar_success); @@ -140,6 +142,9 @@ public class EditProfileActivity extends AbsActivity { JSONObject obj = JSON.parseObject(info[0]); bean.setAvatar(obj.getString("avatar")); bean.setAvatarThumb(obj.getString("avatarThumb")); + mUserBean.setAvatar(obj.getString("avatar")); + mUserBean.setAvatarThumb(obj.getString("avatarThumb")); + V2TIMUserFullInfo v2TIMUserFullInfo = new V2TIMUserFullInfo(); v2TIMUserFullInfo.setFaceUrl(obj.getString("avatarThumb")); V2TIMManager.getInstance().setSelfInfo(v2TIMUserFullInfo, new V2TIMCallback() { @@ -418,7 +423,9 @@ public class EditProfileActivity extends AbsActivity { R.string.camera, R.string.alumb, R.string.me_edit_avatar_system}, new DialogUitl.StringArrayDialogCallback() { @Override public void onItemClick(String text, int tag) { - if (Integer.parseInt(IMLoginManager.get(mContext).getUserInfo().getLevel()) < 5 && tag != R.string.me_edit_avatar_system) { + if ((Integer.parseInt(IMLoginManager.get(mContext).getUserInfo().getLevel()) < 5 && tag != R.string.me_edit_avatar_system)//等级小于5并且不是选择系统头像 + && !IMLoginManager.get(mContext).getUserInfo().anchorUserType()//非主播 + ) { ToastUtil.show(R.string.me_edit_avatar_system_tip); return; }