未播放隐藏按钮
禁止封面点击播放
This commit is contained in:
@@ -51,9 +51,9 @@ public class RecyclerVideoAdapter extends RecyclerView.Adapter<RecyclerItemVideo
|
||||
.setCacheWithPlay(true)
|
||||
.setPlayTag(taxiPassengerVideoPlay.getImageUrl()+position)
|
||||
.setThumbImageView(holder.gsyVideoPlayer.coverImage)
|
||||
.setThumbPlay(true)
|
||||
.setThumbPlay(false)
|
||||
.build(holder.gsyVideoPlayer);
|
||||
holder.gsyVideoPlayer.setTitle(taxiPassengerVideoPlay.getTitle());
|
||||
holder.gsyVideoPlayer.setTitle(taxiPassengerVideoPlay.getTitle()+position);
|
||||
Glide.with(context)
|
||||
.load(taxiPassengerVideoPlay.getImageUrl())
|
||||
.apply(new RequestOptions().placeholder(R.drawable.taxi_p_video_holder).centerCrop())
|
||||
|
||||
@@ -55,30 +55,25 @@ class TaxiPassengerMogoConsultView :RelativeLayout {
|
||||
clContain = findViewById(R.id.cl_contain)
|
||||
|
||||
val arrayListOf = ArrayList<TaxiPassengerVideoPlay>()
|
||||
arrayListOf.add(TaxiPassengerVideoPlay("https://gohome-1253308323.cos.ap-beijing.myqcloud.com/McTk51586843620689.mp4","https://gohome-1253308323.cos.ap-beijing.myqcloud.com/McTk51586843620689.png","title"))
|
||||
arrayListOf.add(TaxiPassengerVideoPlay("https://gohome-1253308323.cos.ap-beijing.myqcloud.com/9890_4e292f9a3dd011e6b4078980237cc3d3.f20.mp4","https://gohome-1253308323.cos.ap-beijing.myqcloud.com/12111.jpg","title"))
|
||||
arrayListOf.add(TaxiPassengerVideoPlay("https://gohome-1253308323.cos.ap-beijing.myqcloud.com/McTk51586843620689.mp4","https://gohome-1253308323.cos.ap-beijing.myqcloud.com/McTk51586843620689.png","title"))
|
||||
arrayListOf.add(TaxiPassengerVideoPlay("https://gohome-1253308323.cos.ap-beijing.myqcloud.com/9890_4e292f9a3dd011e6b4078980237cc3d3.f20.mp4","https://gohome-1253308323.cos.ap-beijing.myqcloud.com/12111.jpg","title"))
|
||||
arrayListOf.add(TaxiPassengerVideoPlay("https://gohome-1253308323.cos.ap-beijing.myqcloud.com/McTk51586843620689.mp4","https://gohome-1253308323.cos.ap-beijing.myqcloud.com/McTk51586843620689.png","title"))
|
||||
arrayListOf.add(TaxiPassengerVideoPlay("https://gohome-1253308323.cos.ap-beijing.myqcloud.com/9890_4e292f9a3dd011e6b4078980237cc3d3.f20.mp4","https://gohome-1253308323.cos.ap-beijing.myqcloud.com/12111.jpg","title"))
|
||||
|
||||
arrayListOf.add(TaxiPassengerVideoPlay("https://img.zhidaohulian.com/fileServer/online_car_hailing/1655708409810/20210610重新排版3屏.m4v","https://gohome-1253308323.cos.ap-beijing.myqcloud.com/McTk51586843620689.png","重新排版"))
|
||||
arrayListOf.add(TaxiPassengerVideoPlay("https://img.zhidaohulian.com/fileServer/online_car_hailing/1655708499497/大运会合作解说版.m4v","https://gohome-1253308323.cos.ap-beijing.myqcloud.com/12111.jpg","大运会合作解说"))
|
||||
arrayListOf.add(TaxiPassengerVideoPlay("https://img.zhidaohulian.com/fileServer/online_car_hailing/1655708554279/红旗车队.m4v","https://gohome-1253308323.cos.ap-beijing.myqcloud.com/McTk51586843620689.png","红旗车队"))
|
||||
arrayListOf.add(TaxiPassengerVideoPlay("https://img.zhidaohulian.com/fileServer/online_car_hailing/1655708596763/全车型混剪增加红旗车队.m4v","https://gohome-1253308323.cos.ap-beijing.myqcloud.com/12111.jpg","全车型混剪增加红旗车队"))
|
||||
arrayListOf.add(TaxiPassengerVideoPlay("https://img.zhidaohulian.com/fileServer/online_car_hailing/1655708499497/大运会合作解说版.m4v","https://gohome-1253308323.cos.ap-beijing.myqcloud.com/12111.jpg","大运会合作解说"))
|
||||
arrayListOf.add(TaxiPassengerVideoPlay("https://img.zhidaohulian.com/fileServer/online_car_hailing/1655708596763/全车型混剪增加红旗车队.m4v","https://gohome-1253308323.cos.ap-beijing.myqcloud.com/12111.jpg","全车型混剪增加红旗车队"))
|
||||
val recyclerVideoAdapter = RecyclerVideoAdapter(context, arrayListOf)
|
||||
val carouselLayoutManager = CarouselLayoutManager(CarouselLayoutManager.HORIZONTAL, true)
|
||||
carouselLayoutManager.setPostLayoutListener(CarouselZoomPostLayoutListener ())
|
||||
carouselLayoutManager.maxVisibleItems = 1
|
||||
rvVideoPlaylist.addOnScrollListener(object: CenterScrollListener() {
|
||||
var currentPausePlayer = -1
|
||||
var prePlayer:ConsultVideoPlayer?=null
|
||||
var prePlayerPosition = 0
|
||||
override fun pageSelect(recyclerView: RecyclerView?, newState: Int) {
|
||||
//播放视频
|
||||
val centerItemPosition: Int = carouselLayoutManager.getCenterItemPosition()
|
||||
val centerItemPosition: Int = carouselLayoutManager.centerItemPosition
|
||||
System.err.println("CarouselZoomPostLayoutListener---centerItemPosition:"+centerItemPosition+"----prePlayerPosition:"+prePlayerPosition);
|
||||
val player = carouselLayoutManager.findViewByPosition(centerItemPosition)
|
||||
if(player is ConsultVideoPlayer){
|
||||
if(currentPausePlayer==-1||currentPausePlayer!=centerItemPosition) {
|
||||
if(prePlayer!=null){
|
||||
prePlayer?.onVideoReset()
|
||||
prePlayer = null
|
||||
}
|
||||
if(prePlayerPosition!=centerItemPosition) {
|
||||
if(player.currentState==GSYVideoView.CURRENT_STATE_PAUSE){
|
||||
player.onVideoReset()
|
||||
player.startPlayLogic()
|
||||
@@ -91,6 +86,7 @@ class TaxiPassengerMogoConsultView :RelativeLayout {
|
||||
player.onVideoResume(false)
|
||||
}
|
||||
}
|
||||
prePlayerPosition = centerItemPosition
|
||||
}
|
||||
|
||||
override fun pageStop() {
|
||||
@@ -98,8 +94,6 @@ class TaxiPassengerMogoConsultView :RelativeLayout {
|
||||
val player = carouselLayoutManager.findViewByPosition(centerItemPosition)
|
||||
if(player is ConsultVideoPlayer){
|
||||
player.onVideoPause()
|
||||
prePlayer = player;
|
||||
currentPausePlayer = centerItemPosition
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.och.taxi.passenger.widget.ConsultVideoPlayer;
|
||||
|
||||
/**
|
||||
* Implementation of {@link CarouselLayoutManager.PostLayoutListener} that makes interesting scaling of items. <br />
|
||||
* We are trying to make items scaling quicker for closer items for center and slower for when they are far away.<br />
|
||||
@@ -45,8 +47,11 @@ public class CarouselZoomPostLayoutListener extends CarouselLayoutManager.PostLa
|
||||
translateX = Math.signum(itemPositionToCenterDiff) * translateXGeneral;
|
||||
translateY = 0;
|
||||
}
|
||||
System.err.println("CarouselZoomPostLayoutListener---itemPositionToCenterDiff:"+itemPositionToCenterDiff);
|
||||
|
||||
if(Math.abs(itemPositionToCenterDiff)==1){
|
||||
if(child instanceof ConsultVideoPlayer){
|
||||
((ConsultVideoPlayer)child).hideAllWidget();
|
||||
}
|
||||
}
|
||||
return new ItemTransformation(scale, scale, translateX, translateY);
|
||||
}
|
||||
}
|
||||
@@ -77,6 +77,14 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
}
|
||||
}
|
||||
|
||||
override fun touchDoubleUp() {
|
||||
|
||||
}
|
||||
|
||||
public override fun hideAllWidget() {
|
||||
super.hideAllWidget()
|
||||
}
|
||||
|
||||
override fun setProgressAndTime(
|
||||
progress: Int,
|
||||
secProgress: Int,
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.4 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 MiB |
Reference in New Issue
Block a user