add videoplay

This commit is contained in:
lixiaopeng
2020-01-05 16:05:17 +08:00
parent 22ee937899
commit 9b48c2f027
18 changed files with 833 additions and 15 deletions

View File

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

View File

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

View File

@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cl_media"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".video.FullMediaActivity">
<!--全屏播放器-->
<com.mogo.tanlu.video.MediaCoverVideoPlayer
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:longClickable="true" />
<!--顶部区域-->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout_media"
android:layout_width="match_parent"
android:layout_height="84dp"
android:background="@color/color_323131"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_media_back"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="18dp"
android:clickable="true"
android:src="@drawable/public_arrow_back_iv"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_media_title_content"
android:layout_width="560dp"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:ellipsize="end"
android:gravity="center"
android:maxWidth="560dp"
android:maxLines="1"
android:textColor="@color/white"
android:textSize="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_media_title_time"
android:layout_width="wrap_content"
android:layout_height="19dp"
android:layout_marginTop="58dp"
android:layout_marginRight="50dp"
android:gravity="center"
android:textColor="@color/white"
android:textSize="17dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.Group
android:id="@+id/group_media"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="constraintLayout_media" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -36,19 +36,32 @@
android:textSize="20dp" />
</RelativeLayout>
<!--播放器-->
<com.mogo.tanlu.video.SimpleCoverVideoPlayer
android:id="@+id/video_player_main"
<!--视频播放器和图片播放器-->
<RelativeLayout
android:id="@+id/media_layout"
android:layout_below="@+id/layout_top_view"
android:layout_width="400dp"
android:layout_height="225dp"
android:layout_below="@+id/layout_top_view" />
android:layout_height="225dp">
<com.mogo.tanlu.video.SimpleCoverVideoPlayer
android:id="@+id/video_player_main"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.mogo.tanlu.view.AutoZoomInImageView
android:id="@+id/tanlu_photo_imageView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
<!--底部view-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@drawable/shape_bg_222533_6px_bottom"
android:layout_below="@+id/video_player_main">
android:layout_below="@+id/media_layout">
<ImageView
android:id="@+id/username_image_video"

View File

@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/item_video_cover"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/surface_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
</RelativeLayout>
<RelativeLayout
android:id="@+id/thumb"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true">
<ImageView
android:id="@+id/thumbImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
</RelativeLayout>
<LinearLayout
android:id="@+id/layout_bottom"
android:layout_width="match_parent"
android:layout_height="72dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="5dp"
android:background="@color/color_99191C25"
android:gravity="center_vertical"
android:orientation="horizontal">
<SeekBar
android:id="@+id/progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@null"
android:max="100"
android:maxHeight="4dp"
android:minHeight="4dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:progressDrawable="@drawable/video_seek_progress"
android:thumb="@drawable/video_seek_thumb" />
<ImageView
android:id="@+id/fullscreen"
android:visibility="gone"
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="centerInside" />
</LinearLayout>
<ImageView
android:id="@+id/start"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical" />
<ProgressBar
android:id="@+id/loading"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminateDrawable="@drawable/loading_bg"
android:visibility="invisible" />
</RelativeLayout>