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
a18f8964
Commit
a18f8964
authored
Aug 10, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
82e84ec3
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
16 deletions
+49
-16
DrawExpressManager.kt
...in/java/com/mints/helivideo/ad/draw/DrawExpressManager.kt
+4
-0
RecommendActivity.kt
...ava/com/mints/helivideo/ui/activitys/RecommendActivity.kt
+11
-0
NewTxVideoActivity.kt
...n/java/com/mints/helivideo/video/tx/NewTxVideoActivity.kt
+6
-11
TXVideoBaseView.java
...in/java/com/mints/helivideo/video/tx/TXVideoBaseView.java
+9
-0
TXVodPlayerWrapper.java
...java/com/mints/helivideo/video/tx/TXVodPlayerWrapper.java
+3
-0
activity_recommend.xml
video/app/src/main/res/layout/activity_recommend.xml
+16
-5
No files found.
video/app/src/main/java/com/mints/helivideo/ad/draw/DrawExpressManager.kt
View file @
a18f8964
...
@@ -212,6 +212,10 @@ class DrawExpressManager {
...
@@ -212,6 +212,10 @@ class DrawExpressManager {
private
fun
showExpressView
(
it
:
TTFeedAd
)
{
private
fun
showExpressView
(
it
:
TTFeedAd
)
{
it
.
setExpressRenderListener
(
object
:
MediationExpressRenderListener
{
it
.
setExpressRenderListener
(
object
:
MediationExpressRenderListener
{
override
fun
onRenderSuccess
(
p0
:
View
?,
p1
:
Float
,
p2
:
Float
,
p3
:
Boolean
)
{
override
fun
onRenderSuccess
(
p0
:
View
?,
p1
:
Float
,
p2
:
Float
,
p3
:
Boolean
)
{
LogUtil
.
d
(
TAG
,
"gromore draw信息流--> 3、Gromore onRenderSuccess expressId=${expressId} "
)
Log
.
i
(
TAG
,
"onRenderSuccess"
)
Log
.
i
(
TAG
,
"onRenderSuccess"
)
it
.
setDislikeCallback
(
ForegroundOrBackground
.
getTopActivity
(),
it
.
setDislikeCallback
(
ForegroundOrBackground
.
getTopActivity
(),
object
:
TTAdDislike
.
DislikeInteractionCallback
{
object
:
TTAdDislike
.
DislikeInteractionCallback
{
...
...
video/app/src/main/java/com/mints/helivideo/ui/activitys/RecommendActivity.kt
View file @
a18f8964
...
@@ -6,12 +6,16 @@ import android.view.View
...
@@ -6,12 +6,16 @@ import android.view.View
import
com.airbnb.lottie.LottieComposition
import
com.airbnb.lottie.LottieComposition
import
com.airbnb.lottie.LottieCompositionFactory
import
com.airbnb.lottie.LottieCompositionFactory
import
com.airbnb.lottie.LottieDrawable
import
com.airbnb.lottie.LottieDrawable
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.google.gson.Gson
import
com.google.gson.Gson
import
com.mints.helivideo.R
import
com.mints.helivideo.R
import
com.mints.helivideo.common.Constant
import
com.mints.helivideo.common.Constant
import
com.mints.helivideo.mvp.model.RecommendBean
import
com.mints.helivideo.mvp.model.RecommendBean
import
com.mints.helivideo.ui.activitys.base.BaseActivity
import
com.mints.helivideo.ui.activitys.base.BaseActivity
import
com.mints.helivideo.utils.LogUtil
import
com.mints.helivideo.video.tx.NewTxVideoActivity
import
com.mints.helivideo.video.tx.NewTxVideoActivity
import
com.mints.helivideo.video.tx.TXVideoBaseView
import
com.mints.helivideo.video.tx.TXVodPlayerWrapper
import
com.mints.helivideo.video.tx.TXVodPlayerWrapper
import
com.mints.helivideo.video.tx.VideoModel
import
com.mints.helivideo.video.tx.VideoModel
import
com.mints.library.utils.json.JsonUtil
import
com.mints.library.utils.json.JsonUtil
...
@@ -58,9 +62,16 @@ class RecommendActivity : BaseActivity(), View.OnClickListener {
...
@@ -58,9 +62,16 @@ class RecommendActivity : BaseActivity(), View.OnClickListener {
}
}
iv_recommend_top
.
setImageDrawable
(
lottieDrawable
)
iv_recommend_top
.
setImageDrawable
(
lottieDrawable
)
Glide
.
with
(
context
).
load
(
recommendBean
?.
vedioMsg
?.
coverImage
)
.
skipMemoryCache
(
true
)
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
).
centerCrop
()
.
into
(
baseItemView
.
findViewById
(
R
.
id
.
iv_cover
))
val
videoModel
=
VideoModel
(
recommendBean
?.
showVedioUrl
)
val
videoModel
=
VideoModel
(
recommendBean
?.
showVedioUrl
)
val
txVodPlayerWrapper
=
TXVodPlayerWrapper
(
mContext
)
val
txVodPlayerWrapper
=
TXVodPlayerWrapper
(
mContext
)
txVodPlayerWrapper
.
preStartPlay
(
videoModel
)
txVodPlayerWrapper
.
preStartPlay
(
videoModel
)
txVodPlayerWrapper
.
setAutoLoop
()
baseItemView
.
hideEmptyView
()
baseItemView
.
setTXVodPlayer
(
txVodPlayerWrapper
)
baseItemView
.
setTXVodPlayer
(
txVodPlayerWrapper
)
baseItemView
.
startPlay
()
baseItemView
.
startPlay
()
}
}
...
...
video/app/src/main/java/com/mints/helivideo/video/tx/NewTxVideoActivity.kt
View file @
a18f8964
...
@@ -22,6 +22,9 @@ import com.mints.helivideo.video.tx.adapter.TxVideoAdapter
...
@@ -22,6 +22,9 @@ import com.mints.helivideo.video.tx.adapter.TxVideoAdapter
import
com.mints.library.utils.nodoubleclick.AntiShake
import
com.mints.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.activity_new_tx_video.*
import
kotlinx.android.synthetic.main.activity_new_tx_video.*
/**
* 推荐剧集二级页
*/
class
NewTxVideoActivity
:
BaseActivity
(),
View
.
OnClickListener
,
VideoView
,
class
NewTxVideoActivity
:
BaseActivity
(),
View
.
OnClickListener
,
VideoView
,
VideoEpisodeAdapter
.
OnEpisodeClickListener
,
TxVideoAdapter
.
OnCustomChildClickListener
{
VideoEpisodeAdapter
.
OnEpisodeClickListener
,
TxVideoAdapter
.
OnCustomChildClickListener
{
...
@@ -53,6 +56,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -53,6 +56,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
val
json
=
extras
?.
getString
(
Constant
.
VEDIO_BEAN
)
val
json
=
extras
?.
getString
(
Constant
.
VEDIO_BEAN
)
isPlayNext
=
extras
?.
getBoolean
(
Constant
.
VEDIO_NEXT
,
false
)
==
true
isPlayNext
=
extras
?.
getBoolean
(
Constant
.
VEDIO_NEXT
,
false
)
==
true
mVedioBean
=
Gson
().
fromJson
(
json
,
VedioBean
::
class
.
java
)
mVedioBean
=
Gson
().
fromJson
(
json
,
VedioBean
::
class
.
java
)
mVedioBean
?.
isRecommendVedio
=
true
orderTagsList
=
mVedioBean
?.
orderTags
orderTagsList
=
mVedioBean
?.
orderTags
if
(
isPlayNext
)
{
if
(
isPlayNext
)
{
mVedioBean
?.
let
{
mVedioBean
?.
let
{
...
@@ -67,7 +71,6 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -67,7 +71,6 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
super_short_video_view
.
resume
()
super_short_video_view
.
resume
()
videoPresenter
.
showTurn
()
if
(
mVipFlag
!=
UserManager
.
getInstance
().
vipFlag
&&
UserManager
.
getInstance
().
vipFlag
)
{
if
(
mVipFlag
!=
UserManager
.
getInstance
().
vipFlag
&&
UserManager
.
getInstance
().
vipFlag
)
{
// 重置状态
// 重置状态
...
@@ -167,6 +170,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -167,6 +170,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
tipList
=
indexList
.
tip
tipList
=
indexList
.
tip
mVedioBean
=
indexList
.
vedioMsg
mVedioBean
=
indexList
.
vedioMsg
mVedioBean
?.
isRecommendVedio
=
true
indexBean
=
indexList
indexBean
=
indexList
videos
.
clear
()
videos
.
clear
()
videos
.
addAll
(
indexList
.
list
)
videos
.
addAll
(
indexList
.
list
)
...
@@ -179,7 +183,6 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -179,7 +183,6 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
}
override
fun
collectSuc
()
{
override
fun
collectSuc
()
{
mVedioBean
!!
.
collect
=
1
}
}
override
fun
collectFail
()
{
override
fun
collectFail
()
{
...
@@ -187,7 +190,6 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -187,7 +190,6 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
}
override
fun
cancelCollectSuc
()
{
override
fun
cancelCollectSuc
()
{
mVedioBean
!!
.
collect
=
0
}
}
override
fun
cancelCollectFail
()
{
override
fun
cancelCollectFail
()
{
...
@@ -238,14 +240,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -238,14 +240,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override
fun
onCustomChildClick
(
view
:
View
,
position
:
Int
)
{
override
fun
onCustomChildClick
(
view
:
View
,
position
:
Int
)
{
when
(
view
.
id
)
{
when
(
view
.
id
)
{
R
.
id
.
ll_collect
->
{
R
.
id
.
ll_collect
->
{
// 收藏
// 无收藏
mVedioBean
?.
let
{
if
(
it
.
collect
==
0
)
{
videoPresenter
.
collect
(
""
+
it
.
vedioId
)
}
else
{
videoPresenter
.
cancelCollect
(
""
+
it
.
vedioId
)
}
}
}
}
R
.
id
.
leave
->
{
R
.
id
.
leave
->
{
// 返回
// 返回
...
...
video/app/src/main/java/com/mints/helivideo/video/tx/TXVideoBaseView.java
View file @
a18f8964
...
@@ -12,6 +12,7 @@ import android.util.Log;
...
@@ -12,6 +12,7 @@ import android.util.Log;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.MotionEvent
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.RelativeLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.SeekBar
;
import
android.widget.SeekBar
;
...
@@ -19,6 +20,7 @@ import android.widget.TextView;
...
@@ -19,6 +20,7 @@ import android.widget.TextView;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
import
com.mints.helivideo.utils.UIUtils
;
import
com.tencent.rtmp.TXLiveConstants
;
import
com.tencent.rtmp.TXLiveConstants
;
import
com.tencent.rtmp.ui.TXCloudVideoView
;
import
com.tencent.rtmp.ui.TXCloudVideoView
;
import
com.mints.helivideo.R
;
import
com.mints.helivideo.R
;
...
@@ -37,6 +39,7 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
...
@@ -37,6 +39,7 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
private
ImageView
mIvCover
;
private
ImageView
mIvCover
;
private
ImageView
mPauseImageView
;
private
ImageView
mPauseImageView
;
private
TextView
mProgressTime
;
private
TextView
mProgressTime
;
private
View
mEmptyView
;
private
TXVodPlayerWrapper
mTXVodPlayerWrapper
;
private
TXVodPlayerWrapper
mTXVodPlayerWrapper
;
private
boolean
mStartSeek
=
false
;
private
boolean
mStartSeek
=
false
;
...
@@ -78,6 +81,7 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
...
@@ -78,6 +81,7 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
mTXCloudVideoView
.
setOnClickListener
(
this
);
mTXCloudVideoView
.
setOnClickListener
(
this
);
mProgressTime
=
mRootView
.
findViewById
(
R
.
id
.
tv_progress_time
);
mProgressTime
=
mRootView
.
findViewById
(
R
.
id
.
tv_progress_time
);
setProgressTimeColor
(
mProgressTime
.
getText
().
toString
());
setProgressTimeColor
(
mProgressTime
.
getText
().
toString
());
mEmptyView
=
mRootView
.
findViewById
(
R
.
id
.
empty_view
);
mProgressTime
.
setVisibility
(
View
.
GONE
);
mProgressTime
.
setVisibility
(
View
.
GONE
);
mSeekBar
.
setOnTouchListener
(
new
OnTouchListener
()
{
mSeekBar
.
setOnTouchListener
(
new
OnTouchListener
()
{
...
@@ -208,6 +212,11 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
...
@@ -208,6 +212,11 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
mStartSeek
=
false
;
mStartSeek
=
false
;
}
}
public
void
hideEmptyView
()
{
ViewGroup
.
LayoutParams
layoutParams
=
mEmptyView
.
getLayoutParams
();
layoutParams
.
height
=
UIUtils
.
dip2px
(
getContext
(),
20
);
mEmptyView
.
setLayoutParams
(
layoutParams
);
}
public
void
pausePlayer
()
{
public
void
pausePlayer
()
{
if
(
mTXVodPlayerWrapper
!=
null
)
{
if
(
mTXVodPlayerWrapper
!=
null
)
{
...
...
video/app/src/main/java/com/mints/helivideo/video/tx/TXVodPlayerWrapper.java
View file @
a18f8964
...
@@ -153,6 +153,9 @@ public class TXVodPlayerWrapper implements ITXVodPlayListener {
...
@@ -153,6 +153,9 @@ public class TXVodPlayerWrapper implements ITXVodPlayListener {
mVodPlayer
.
setPlayerView
(
txCloudVideoView
);
mVodPlayer
.
setPlayerView
(
txCloudVideoView
);
}
}
public
void
setAutoLoop
()
{
mVodPlayer
.
setLoop
(
true
);
}
public
void
preStartPlay
(
VideoModel
bean
)
{
public
void
preStartPlay
(
VideoModel
bean
)
{
this
.
mUrl
=
bean
.
videoURL
;
this
.
mUrl
=
bean
.
videoURL
;
...
...
video/app/src/main/res/layout/activity_recommend.xml
View file @
a18f8964
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#90000000"
android:background=
"#90000000"
...
@@ -16,11 +17,20 @@
...
@@ -16,11 +17,20 @@
android:layout_width=
"330dp"
android:layout_width=
"330dp"
android:layout_height=
"420dp"
>
android:layout_height=
"420dp"
>
<androidx.cardview.widget.CardView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:cardBackgroundColor=
"@android:color/transparent"
app:cardCornerRadius=
"@dimen/dp_10"
>
<com.mints.helivideo.video.tx.TXVideoBaseView
<com.mints.helivideo.video.tx.TXVideoBaseView
android:id=
"@+id/baseItemView"
android:id=
"@+id/baseItemView"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
</androidx.cardview.widget.CardView>
<ImageView
<ImageView
android:id=
"@+id/ic_recommend_quit"
android:id=
"@+id/ic_recommend_quit"
android:layout_width=
"60dp"
android:layout_width=
"60dp"
...
@@ -28,6 +38,7 @@
...
@@ -28,6 +38,7 @@
android:layout_alignParentEnd=
"true"
android:layout_alignParentEnd=
"true"
android:layout_gravity=
"end"
android:layout_gravity=
"end"
android:layout_marginTop=
"2dp"
android:layout_marginTop=
"2dp"
android:elevation=
"2dp"
android:padding=
"10dp"
android:padding=
"10dp"
android:scaleType=
"centerCrop"
android:scaleType=
"centerCrop"
android:src=
"@mipmap/ic_quit_yuan"
/>
android:src=
"@mipmap/ic_quit_yuan"
/>
...
@@ -36,8 +47,8 @@
...
@@ -36,8 +47,8 @@
<RelativeLayout
<RelativeLayout
android:id=
"@+id/fl_recommend_next"
android:id=
"@+id/fl_recommend_next"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_
marginTop=
"1
0dp"
android:layout_
height=
"10
0dp"
android:layout_
height=
"10
0dp"
>
android:layout_
marginTop=
"1
0dp"
>
<ImageView
<ImageView
android:id=
"@+id/iv_recommend_top"
android:id=
"@+id/iv_recommend_top"
...
...
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