[宣传视频] fix: media个数为2个时,播放按钮 显示问题;
This commit is contained in:
@@ -22,6 +22,7 @@ import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
import com.mogo.och.charter.passenger.R
|
||||
import com.mogo.och.charter.passenger.utils.FullVideoUtils
|
||||
import com.mogo.och.common.module.wigets.media.MediaItem
|
||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
|
||||
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
|
||||
@@ -51,6 +52,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
var smalllPlayer: ConsultVideoPlayer?=null
|
||||
|
||||
private var currentTime = 0
|
||||
private var fileType = 0
|
||||
|
||||
constructor(context: Context?) : super(context)
|
||||
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
|
||||
@@ -125,7 +127,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
}else {
|
||||
start.setImageResource(R.drawable.charter_p_function_video_player_pause_small)
|
||||
}
|
||||
aivStartPlay.visibility = View.GONE
|
||||
showOrHideStartPlayButton(false)
|
||||
}
|
||||
else -> {
|
||||
if(isIfCurrentIsFullscreen){
|
||||
@@ -133,7 +135,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
}else {
|
||||
start.setImageResource(R.drawable.charter_p_function_video_player_start_small)
|
||||
}
|
||||
aivStartPlay.visibility = View.VISIBLE
|
||||
showOrHideStartPlayButton(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -491,7 +493,15 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
return mVideoAllCallBack
|
||||
}
|
||||
|
||||
fun setFileType(type: Int) {
|
||||
this.fileType = type
|
||||
}
|
||||
|
||||
fun showOrHideStartPlayButton(isShow: Boolean) {
|
||||
if (fileType == MediaItem.MEDIA_TYPE_IMAGE) {
|
||||
aivStartPlay?.visibility = View.GONE
|
||||
return
|
||||
}
|
||||
aivStartPlay?.visibility = if (isShow ) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ public class RecyclerVideoAdapter extends RecyclerView.Adapter<RecyclerItemVideo
|
||||
.setThumbPlay(false)
|
||||
.setStartAfterPrepared(isVideo ? true : false)
|
||||
.build(holder.gsyVideoPlayer);
|
||||
holder.gsyVideoPlayer.setFileType(taxiPassengerVideoPlay.getType());
|
||||
|
||||
String imageUrl;
|
||||
if (isVideo) {
|
||||
imageUrl = taxiPassengerVideoPlay.getImageUrl();
|
||||
|
||||
@@ -63,7 +63,7 @@ public class RecyclerVideoAdapter extends RecyclerView.Adapter<RecyclerItemVideo
|
||||
.setThumbPlay(false)
|
||||
.setStartAfterPrepared(isVideo ? true : false)
|
||||
.build(holder.gsyVideoPlayer);
|
||||
holder.gsyVideoPlayer.getTitleTextView().setText(taxiPassengerVideoPlay.getTitle());
|
||||
holder.gsyVideoPlayer.setFileType(taxiPassengerVideoPlay.getType());
|
||||
|
||||
String imageUrl;
|
||||
if (isVideo) {
|
||||
@@ -85,6 +85,7 @@ public class RecyclerVideoAdapter extends RecyclerView.Adapter<RecyclerItemVideo
|
||||
} else {
|
||||
holder.gsyVideoPlayer.getThumbImageViewLayout().setOnClickListener(null);
|
||||
}
|
||||
holder.gsyVideoPlayer.getTitleTextView().setText(taxiPassengerVideoPlay.getTitle());
|
||||
holder.gsyVideoPlayer.getFullscreenButton().setVisibility(isVideo ? View.VISIBLE : View.INVISIBLE);
|
||||
holder.gsyVideoPlayer.getStartButton().setVisibility(isVideo ? View.VISIBLE : View.INVISIBLE);
|
||||
holder.gsyVideoPlayer.showOrHideStartPlayButton(isVideo ? true : false);
|
||||
|
||||
@@ -20,6 +20,8 @@ import androidx.core.app.ActivityCompat
|
||||
import com.mogo.eagle.core.utilcode.util.TimeTransformUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
import com.mogo.och.common.module.wigets.media.MediaData
|
||||
import com.mogo.och.common.module.wigets.media.MediaItem
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.ui.statusview.StatusBarView
|
||||
import com.mogo.och.taxi.passenger.ui.video.FullVideoUtils
|
||||
@@ -54,6 +56,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
private var statusBarView: StatusBarView? = null
|
||||
|
||||
private var currentTime = 0
|
||||
private var fileType = 0
|
||||
|
||||
constructor(context: Context?) : super(context)
|
||||
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
|
||||
@@ -134,11 +137,11 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
when (mCurrentState) {
|
||||
GSYVideoView.CURRENT_STATE_PLAYING ->{
|
||||
start.setImageResource(R.drawable.notice_video_pause)
|
||||
aivStartPlay.visibility = View.GONE
|
||||
showOrHideStartPlayButton(false)
|
||||
}
|
||||
else -> {
|
||||
start.setImageResource(R.drawable.notice_video_after_pause)
|
||||
aivStartPlay.visibility = View.VISIBLE
|
||||
showOrHideStartPlayButton(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -528,7 +531,15 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
return mVideoAllCallBack
|
||||
}
|
||||
|
||||
fun setFileType(type: Int) {
|
||||
this.fileType = type
|
||||
}
|
||||
|
||||
fun showOrHideStartPlayButton(isShow: Boolean) {
|
||||
if (fileType == MediaItem.MEDIA_TYPE_IMAGE) {
|
||||
aivStartPlay?.visibility = View.GONE
|
||||
return
|
||||
}
|
||||
aivStartPlay?.visibility = if (isShow ) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user