视频组件更换StandardGSYVideoPlayer
This commit is contained in:
31
app/src/main/res/drawable/progress_video.xml
Normal file
31
app/src/main/res/drawable/progress_video.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- 背景 -->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="2dp"/>
|
||||
<solid android:color="#333333"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- 缓冲 -->
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="2dp"/>
|
||||
<solid android:color="#888888"/>
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
<!-- 播放进度 -->
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="2dp"/>
|
||||
<solid android:color="#09C2BD"/>
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
11
app/src/main/res/drawable/thumb_video.xml
Normal file
11
app/src/main/res/drawable/thumb_video.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<size
|
||||
android:width="12dp"
|
||||
android:height="12dp"/>
|
||||
|
||||
<solid android:color="#09C2BD"/>
|
||||
|
||||
<corners android:radius="6dp"/>
|
||||
|
||||
</shape>
|
||||
@@ -2,10 +2,8 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#000000"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 视频播放区域和悬浮按钮 -->
|
||||
@@ -14,137 +12,51 @@
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- 视频播放区域 -->
|
||||
<chuangyuan.ycj.videolibrary.widget.VideoPlayerView
|
||||
<com.example.defenseapplication.view.MyGSYVideoPlayer
|
||||
android:layout_marginTop="40dp"
|
||||
android:id="@+id/exoPlayContextId"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="280dp"
|
||||
android:background="@android:color/transparent"
|
||||
app:use_controller="false"/>
|
||||
android:layout_height="280dp"/>
|
||||
|
||||
<!-- 自定义顶部栏 - 返回、下载、删除在同一行 -->
|
||||
<!-- 右上侧按钮层 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/functionBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:layout_gravity="top"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBack"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/back_white"/>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
android:layout_marginTop="50dp"
|
||||
android:id="@+id/rightMenu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivDownload"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:padding="8dp"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/download"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivDelete"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:padding="8dp"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:src="@drawable/delete"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 右下角按钮区域 - 静音、全屏按钮 -->
|
||||
<!-- 右下侧按钮层 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/muteBar"
|
||||
android:id="@+id/rightDow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_marginEnd="15dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivMute"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:padding="8dp"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:src="@drawable/un_mute"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFullScreen"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:padding="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:src="@drawable/full_size"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 左下角播放按钮 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/playBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|start">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivPlay"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/zt"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 底部进度条和时间区域 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="70dp"
|
||||
android:paddingRight="70dp">
|
||||
|
||||
<!-- 当前时间 -->
|
||||
<TextView
|
||||
android:id="@+id/tvCurrentTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="00:00"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
<!-- 进度条 -->
|
||||
<SeekBar
|
||||
android:id="@+id/seekBar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:progressDrawable="@drawable/custom_seekbar"
|
||||
android:thumb="@drawable/custom_thumb"/>
|
||||
|
||||
<!-- 总时长 -->
|
||||
<TextView
|
||||
android:id="@+id/tvTotalTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="00:00"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
Reference in New Issue
Block a user