[add] 暂存 尝试解决视频播放器圆角

This commit is contained in:
liujing
2021-11-16 15:32:58 +08:00
parent ca1426d2f8
commit 22bbceb2af
6 changed files with 69 additions and 3 deletions

View File

@@ -71,6 +71,8 @@ dependencies {
api rootProject.ext.dependencies.videoarm64
api rootProject.ext.dependencies.videojava
api rootProject.ext.dependencies.livesdk
implementation 'com.android.support:cardview-v7:26.1.0'
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogo_core_utils

View File

@@ -0,0 +1,22 @@
package com.mogo.eagle.core.widget.media.video;
import android.content.Context;
import android.view.ViewGroup;
import com.shuyu.gsyvideoplayer.render.GSYRenderView;
import com.shuyu.gsyvideoplayer.render.glrender.GSYVideoGLViewBaseRender;
import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView;
import com.shuyu.gsyvideoplayer.render.view.listener.IGSYSurfaceListener;
import com.shuyu.gsyvideoplayer.utils.MeasureHelper;
/**
* @author Jing
* @description 描述
* @since: 11/16/21
*/
public class NoticeGSYRenderView extends GSYRenderView {
@Override
public void addView(Context context, ViewGroup textureViewContainer, int rotate, IGSYSurfaceListener gsySurfaceListener, MeasureHelper.MeasureFormVideoParamsListener videoParamsListener, GSYVideoGLView.ShaderInterface effect, float[] transform, GSYVideoGLViewBaseRender customRender, int mode) {
super.addView(context, textureViewContainer, rotate, gsySurfaceListener, videoParamsListener, effect, transform, customRender, mode);
}
}

View File

@@ -188,6 +188,7 @@ class NoticeSimpleSmallVideoPlayer : StandardGSYVideoPlayer {
override fun onPrepared() {
super.onPrepared()
playListener?.onPlayEvent(PLAY_EVT_PLAY_LOADING)
}

View File

@@ -0,0 +1,34 @@
package com.mogo.eagle.core.widget.media.video;
import android.graphics.Outline;
import android.graphics.Rect;
import android.os.Build;
import android.view.View;
import android.view.ViewOutlineProvider;
import androidx.annotation.RequiresApi;
/**
* @author Jing
* @description 描述
* @since: 11/16/21
*/
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public class TextureVideoViewOutlineProvider extends ViewOutlineProvider {
private float mRadius;
public TextureVideoViewOutlineProvider(float radius) {
this.mRadius = radius;
}
@Override
public void getOutline(View view, Outline outline) {
Rect rect = new Rect();
view.getGlobalVisibleRect(rect);
int leftMargin = 0;
int topMargin = 0;
Rect selfRect = new Rect(leftMargin, topMargin,
rect.right - rect.left - leftMargin, rect.bottom - rect.top - topMargin);
outline.setRoundRect(selfRect, mRadius);
}
}

View File

@@ -48,9 +48,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/notice_time_bottom"
android:gravity="center_vertical"
android:text="02:23"
android:layout_marginBottom="@dimen/notice_time_bottom"
android:textColor="@android:color/white"
android:textSize="@dimen/time_textsize" />
@@ -59,10 +59,10 @@
android:layout_width="@dimen/notice_seekbar_width_small"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/notice_seekbar_bottom"
android:max="100"
android:maxHeight="8px"
android:minHeight="8px"
android:layout_marginBottom="@dimen/notice_seekbar_bottom"
android:progressDrawable="@drawable/notice_seekbar_style"
android:thumb="@drawable/notice_player_ic_circle_nor" />
@@ -72,8 +72,8 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/notice_time_bottom"
android:text="08:66"
android:gravity="center_vertical"
android:text="08:66"
android:textColor="@android:color/white"
android:textSize="@dimen/time_textsize" />

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>