diff --git a/video/src/main/java/com/yunbao/video/views/VideoPlayViewHolder.java b/video/src/main/java/com/yunbao/video/views/VideoPlayViewHolder.java index a14cfb8bc..2f1fe2ea3 100644 --- a/video/src/main/java/com/yunbao/video/views/VideoPlayViewHolder.java +++ b/video/src/main/java/com/yunbao/video/views/VideoPlayViewHolder.java @@ -87,9 +87,11 @@ public class VideoPlayViewHolder extends AbsViewHolder implements View.OnClickLi @Override public void onVideoSizeChanged(VideoSize videoSize) { Player.Listener.super.onVideoSizeChanged(videoSize); - if (mActionListener != null) { + /*if (mActionListener != null) { mActionListener.onVideoSize(videoSize.height, videoSize.width); - } + }*/ + L.e("onVideoSizeChanged————Height----"+videoSize.height); + L.e("onVideoSizeChanged————Width----"+videoSize.width); } @Override @@ -164,6 +166,12 @@ public class VideoPlayViewHolder extends AbsViewHolder implements View.OnClickLi } } + @Override + public void onDestroy() { + super.onDestroy(); + } + + /** * 循环播放 */ diff --git a/video/src/main/java/com/yunbao/video/views/VideoPlayWrapViewHolder.java b/video/src/main/java/com/yunbao/video/views/VideoPlayWrapViewHolder.java index daa73df71..24b233702 100644 --- a/video/src/main/java/com/yunbao/video/views/VideoPlayWrapViewHolder.java +++ b/video/src/main/java/com/yunbao/video/views/VideoPlayWrapViewHolder.java @@ -7,6 +7,7 @@ import android.os.Bundle; import androidx.core.content.ContextCompat; +import android.util.Log; import android.util.SparseArray; import android.view.View; import android.view.ViewGroup; @@ -32,6 +33,7 @@ import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.utils.DialogUitl; +import com.yunbao.common.utils.L; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; @@ -229,9 +231,9 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli } mVideoBean = bean; if (payload == null) { - if (mCover != null) { + /*if (mCover != null) { setCoverImage(); - } + }*/ if (mTitle != null) { mTitle.setText(String.valueOf(JSONObject.parseObject(bean.getContent()).get("msg"))); } @@ -303,6 +305,8 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli mCover.requestLayout(); } mCover.setImageDrawable(drawable); + L.e("setCoverImage————Height----"+mCover.getHeight()); + L.e("setCoverImage————Width----"+mCover.getWidth()); } } @@ -348,17 +352,20 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli * 获取到视频首帧回调 */ public void onFirstFrame() { - if (mCover != null && mCover.getVisibility() == View.VISIBLE) { + /*if (mCover != null && mCover.getVisibility() == View.VISIBLE) { mCover.setVisibility(View.INVISIBLE); - } + }*/ } public void onSetVideoCoverSize(int height, int width) { - if (mCover != null) { + /* if (mCover != null) { RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mCover.getLayoutParams(); params.width = width; params.height = height; } + if (mCover != null) { + setCoverImage(); + }*/ } @@ -376,13 +383,13 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli * 滑入屏幕 */ public void onPageInWindow() { - if (mCover != null) { + /*if (mCover != null) { if (mCover.getVisibility() != View.VISIBLE) { mCover.setVisibility(View.VISIBLE); } mCover.setImageDrawable(null); setCoverImage(); - } + }*/ } /** diff --git a/video/src/main/res/layout/view_video_play_wrap.xml b/video/src/main/res/layout/view_video_play_wrap.xml index 7f552263f..5f753e0f8 100644 --- a/video/src/main/res/layout/view_video_play_wrap.xml +++ b/video/src/main/res/layout/view_video_play_wrap.xml @@ -15,6 +15,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerHorizontal="true" + android:visibility="gone" android:layout_centerVertical="true" android:scaleType="centerCrop" />