Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_vedio
Commits
a43d0488
Commit
a43d0488
authored
Jul 25, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
96fa9a9a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
96 additions
and
49 deletions
+96
-49
TXVideoBaseView.java
...in/java/com/mints/helivideo/video/tx/TXVideoBaseView.java
+24
-29
player_thumb_view_small.xml
video/app/src/main/res/drawable/player_thumb_view_small.xml
+16
-0
player_video_seek_bar.xml
video/app/src/main/res/drawable/player_video_seek_bar.xml
+18
-9
player_video_seek_bar_small.xml
...app/src/main/res/drawable/player_video_seek_bar_small.xml
+36
-0
player_item_base_view.xml
video/app/src/main/res/layout/player_item_base_view.xml
+2
-11
No files found.
video/app/src/main/java/com/mints/helivideo/video/tx/TXVideoBaseView.java
View file @
a43d0488
...
...
@@ -3,6 +3,7 @@ package com.mints.helivideo.video.tx;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.text.SpannableStringBuilder
;
import
android.text.Spanned
;
...
...
@@ -13,11 +14,11 @@ import android.view.LayoutInflater;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.ProgressBar
;
import
android.widget.RelativeLayout
;
import
android.widget.SeekBar
;
import
android.widget.TextView
;
import
com.mints.helivideo.utils.UIUtils
;
import
com.tencent.rtmp.TXLiveConstants
;
import
com.tencent.rtmp.ui.TXCloudVideoView
;
import
com.mints.helivideo.R
;
...
...
@@ -31,7 +32,6 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
SeekBar
.
OnSeekBarChangeListener
,
TXVodPlayerWrapper
.
OnPlayEventChangedListener
{
private
static
final
String
TAG
=
"TXVideoBaseView"
;
private
View
mRootView
;
private
ProgressBar
mBgProgress
;
private
SeekBar
mSeekBar
;
private
TXCloudVideoView
mTXCloudVideoView
;
private
ImageView
mIvCover
;
...
...
@@ -68,7 +68,6 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
private
void
init
(
Context
context
)
{
mRootView
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
player_item_base_view
,
null
);
addView
(
mRootView
);
mBgProgress
=
mRootView
.
findViewById
(
R
.
id
.
progress_short_video
);
mSeekBar
=
mRootView
.
findViewById
(
R
.
id
.
seekbar_short_video
);
mSeekBar
.
setOnSeekBarChangeListener
(
this
);
mIvCover
=
mRootView
.
findViewById
(
R
.
id
.
iv_cover
);
...
...
@@ -95,30 +94,28 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
}
});
mBgProgress
.
setVisibility
(
View
.
GONE
);
// mSeekBar.setVisibility(View.GONE);
// mProgressTime.setVisibility(View.GONE);
//
// OnTouchListener listener = new OnTouchListener() {
// @Override
// public boolean onTouch(View v, MotionEvent event) {
// switch (event.getAction()) {
// case MotionEvent.ACTION_DOWN:
// mBgProgress.setVisibility(View.GONE);
// mSeekBar.setVisibility(View.VISIBLE);
// mProgressTime.setVisibility(View.VISIBLE);
// break;
// case MotionEvent.ACTION_UP:
// mBgProgress.setVisibility(View.VISIBLE);
// mSeekBar.setVisibility(View.GONE);
// mProgressTime.setVisibility(View.GONE);
// break;
// }
// return false;
// }
// };
// mBgProgress.setOnTouchListener(listener);
// mSeekBar.setOnTouchListener(listener);
mSeekBar
.
setVisibility
(
View
.
VISIBLE
);
mProgressTime
.
setVisibility
(
View
.
GONE
);
OnTouchListener
listener
=
new
OnTouchListener
()
{
@Override
public
boolean
onTouch
(
View
v
,
MotionEvent
event
)
{
switch
(
event
.
getAction
())
{
case
MotionEvent
.
ACTION_DOWN
:
mSeekBar
.
setThumb
(
getResources
().
getDrawable
(
R
.
drawable
.
player_thumb_view
));
mSeekBar
.
setProgressDrawable
(
getResources
().
getDrawable
(
R
.
drawable
.
player_video_seek_bar
));
mProgressTime
.
setVisibility
(
View
.
VISIBLE
);
break
;
case
MotionEvent
.
ACTION_UP
:
mSeekBar
.
setThumb
(
getResources
().
getDrawable
(
R
.
drawable
.
player_thumb_view_small
));
mSeekBar
.
setProgressDrawable
(
getResources
().
getDrawable
(
R
.
drawable
.
player_video_seek_bar_small
));
mProgressTime
.
setVisibility
(
View
.
GONE
);
break
;
}
return
false
;
}
};
mSeekBar
.
setOnTouchListener
(
listener
);
}
private
void
handlePlayProgress
(
Bundle
param
)
{
...
...
@@ -142,8 +139,6 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
if
(
mSeekBar
!=
null
)
{
mSeekBar
.
setMax
(
durationMS
);
mSeekBar
.
setProgress
(
progressMS
);
mBgProgress
.
setMax
(
durationMS
);
mBgProgress
.
setProgress
(
progressMS
);
}
if
(
mProgressTime
!=
null
)
{
String
tempString
=
String
.
format
(
Locale
.
CHINA
,
"%02d:%02d/%02d:%02d"
,
(
progress
)
/
60
,
progress
%
60
,
(
duration
)
/
60
,
duration
%
60
);
...
...
video/app/src/main/res/drawable/player_thumb_view_small.xml
0 → 100644
View file @
a43d0488
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:state_pressed=
"true"
>
<shape>
<solid
android:color=
"#FFFFFFFF"
/>
<size
android:width=
"4dp"
android:height=
"4dp"
/>
</shape>
</item>
<item>
<shape
android:shape=
"oval"
>
<solid
android:color=
"#FFFFFFFF"
/>
<size
android:width=
"4dp"
android:height=
"4dp"
/>
</shape>
</item>
</selector>
\ No newline at end of file
video/app/src/main/res/drawable/player_video_seek_bar.xml
View file @
a43d0488
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:id=
"@android:id/background"
android:height=
"5dp"
>
<item
android:id=
"@android:id/background"
android:height=
"6dp"
android:left=
"-2dp"
>
<shape>
<corners
android:radius=
"
5dp"
/>
<solid
android:color=
"#4CD8D8D8"
/>
<!-- 颜色-->
<corners
android:radius=
"
6dp"
/>
<solid
android:color=
"#4CD8D8D8"
/>
<!-- 颜色-->
</shape>
</item>
<item
android:id=
"@android:id/secondaryProgress"
android:height=
"5dp"
>
<item
android:id=
"@android:id/secondaryProgress"
android:height=
"6dp"
android:left=
"-2dp"
>
<clip>
<shape>
<corners
android:radius=
"
5dp"
/>
<solid
android:color=
"#20B2AA"
/>
<!-- 颜色-->
<corners
android:radius=
"
6dp"
/>
<solid
android:color=
"#20B2AA"
/>
<!-- 颜色-->
</shape>
</clip>
</item>
<item
android:id=
"@android:id/progress"
android:height=
"5dp"
>
<item
android:id=
"@android:id/progress"
android:height=
"6dp"
android:left=
"-2dp"
>
<clip>
<shape>
<corners
android:radius=
"
5dp"
/>
<solid
android:color=
"#C9C7C7"
/>
<!-- 颜色-->
<corners
android:radius=
"
6dp"
/>
<solid
android:color=
"#C9C7C7"
/>
<!-- 颜色-->
</shape>
</clip>
</item>
...
...
video/app/src/main/res/drawable/player_video_seek_bar_small.xml
0 → 100644
View file @
a43d0488
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:id=
"@android:id/background"
android:height=
"2dp"
android:top=
"1.75dp"
>
<shape>
<corners
android:radius=
"2dp"
/>
<solid
android:color=
"#4CD8D8D8"
/>
<!-- 颜色-->
</shape>
</item>
<item
android:id=
"@android:id/secondaryProgress"
android:height=
"2dp"
android:top=
"1.75dp"
>
<clip>
<shape>
<corners
android:radius=
"2dp"
/>
<solid
android:color=
"#20B2AA"
/>
<!-- 颜色-->
</shape>
</clip>
</item>
<item
android:id=
"@android:id/progress"
android:height=
"2dp"
android:top=
"1.75dp"
>
<clip>
<shape>
<corners
android:radius=
"2dp"
/>
<solid
android:color=
"#C9C7C7"
/>
<!-- 颜色-->
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
video/app/src/main/res/layout/player_item_base_view.xml
View file @
a43d0488
...
...
@@ -31,8 +31,8 @@
android:layout_above=
"@id/empty_view"
android:maxHeight=
"6dp"
android:minHeight=
"6dp"
android:progressDrawable=
"@drawable/player_video_seek_bar"
android:thumb=
"@drawable/player_thumb_view"
/>
android:progressDrawable=
"@drawable/player_video_seek_bar
_small
"
android:thumb=
"@drawable/player_thumb_view
_small
"
/>
<TextView
android:id=
"@+id/tv_progress_time"
...
...
@@ -46,15 +46,6 @@
android:text=
"00:00/00:00"
android:textSize=
"16sp"
/>
<ProgressBar
android:id=
"@+id/progress_short_video"
style=
"?android:attr/progressBarStyleHorizontal"
android:layout_width=
"match_parent"
android:layout_height=
"6dp"
android:layout_above=
"@id/empty_view"
android:max=
"100"
android:progressDrawable=
"@drawable/jz_bottom_seek_progress"
/>
<ImageView
android:id=
"@+id/iv_pause"
android:layout_width=
"80dp"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment