全屏直播自定义功能按钮

This commit is contained in:
2026-06-10 16:01:24 +08:00
parent 0f07736d1e
commit 09fdb75644
52 changed files with 116 additions and 20 deletions

View File

@@ -33,7 +33,7 @@ class MyGSYVideoPlayerLive @JvmOverloads constructor(
) as MyGSYVideoPlayerLive ) as MyGSYVideoPlayerLive
// 隐藏GSY自带UI // 隐藏GSY自带UI
player.backButton.visibility = View.GONE //player.backButton.visibility = View.GONE
player.titleTextView.visibility = View.GONE player.titleTextView.visibility = View.GONE
player.startButton.visibility = View.GONE player.startButton.visibility = View.GONE
player.fullscreenButton.visibility = View.GONE player.fullscreenButton.visibility = View.GONE

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/down2" android:state_pressed="true" /> <item android:drawable="@mipmap/down2" android:state_pressed="true" />
<item android:drawable="@drawable/down" /> <item android:drawable="@mipmap/down" />
</selector> </selector>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/left2" android:state_pressed="true" /> <item android:drawable="@mipmap/left2" android:state_pressed="true" />
<item android:drawable="@drawable/left" /> <item android:drawable="@mipmap/left" />
</selector> </selector>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/right2" android:state_pressed="true" /> <item android:drawable="@mipmap/right2" android:state_pressed="true" />
<item android:drawable="@drawable/right" /> <item android:drawable="@mipmap/right" />
</selector> </selector>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/up2" android:state_pressed="true" /> <item android:drawable="@mipmap/up2" android:state_pressed="true" />
<item android:drawable="@drawable/up" /> <item android:drawable="@mipmap/up" />
</selector> </selector>

View File

@@ -0,0 +1,4 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#80000000"/>
<corners android:radius="2dp"/>
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/down" android:state_pressed="true" />
<item android:drawable="@mipmap/video_down" />
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/left" android:state_pressed="true" />
<item android:drawable="@mipmap/video_left" />
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/right" android:state_pressed="true" />
<item android:drawable="@mipmap/video_right" />
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/up" android:state_pressed="true" />
<item android:drawable="@mipmap/video_up" />
</selector>

View File

@@ -12,38 +12,110 @@
<!-- 顶部栏 --> <!-- 顶部栏 -->
<LinearLayout <LinearLayout
android:orientation="vertical" android:layout_marginEnd="20dp"
android:layout_marginStart="20dp" android:orientation="horizontal"
android:layout_marginTop="20dp" android:layout_marginTop="10dp"
android:layout_marginStart="50dp"
android:id="@+id/topBar" android:id="@+id/topBar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/semi_transparent_black"
android:padding="5dp"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:text="实时监控时间"
android:textColor="#fff" />
<!-- 弹性空白,将后面的内容推到最右边 -->
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:background="@drawable/semi_transparent_black"
android:padding="5dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="实时监控" android:text="实时监控名称"
android:textColor="#fff" /> android:textColor="#fff" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_marginBottom="20dp" android:id="@+id/consoleBar"
android:layout_marginStart="20dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|start" android:layout_gravity="bottom|start"
android:orientation="vertical"> android:orientation="vertical">
<!-- 圆形控制台 -->
<RelativeLayout
android:layout_width="200dp"
android:layout_height="200dp">
<!-- 圆形背景 -->
<ImageView <ImageView
android:layout_width="80dp" android:layout_width="match_parent"
android:layout_height="80dp" android:layout_height="match_parent" />
android:src="@mipmap/ky"/>
<!-- 上按钮 -->
<ImageView
android:id="@+id/ivUp"
android:layout_width="108dp"
android:layout_height="108dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:src="@drawable/video_up"
android:clickable="true"
android:focusable="true" />
<!-- 下按钮 -->
<ImageView
android:id="@+id/ivDown"
android:layout_width="108dp"
android:layout_height="108dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="8dp"
android:src="@drawable/video_down"
android:clickable="true"
android:focusable="true" />
<!-- 左按钮 -->
<ImageView
android:id="@+id/ivLeft"
android:layout_width="108dp"
android:layout_height="108dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:src="@drawable/video_left"
android:clickable="true"
android:focusable="true" />
<!-- 右按钮 -->
<ImageView
android:id="@+id/ivRight"
android:layout_width="108dp"
android:layout_height="108dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="8dp"
android:src="@drawable/video_right"
android:clickable="true"
android:focusable="true" />
</RelativeLayout>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
android:layout_marginStart="20dp" android:layout_marginStart="25dp"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="wrap_content" android:layout_width="wrap_content"

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB