视频播放改到单独的进程
This commit is contained in:
@@ -6,9 +6,8 @@ package com.mogo.och.taxi.passenger.mulprocess;
|
||||
interface ILeftMenuService {
|
||||
|
||||
/**
|
||||
* 向主进程传输坐标
|
||||
* 向主进程传选中的item
|
||||
*/
|
||||
boolean transmission(int x, int action);
|
||||
void transmissionIndex(int index);
|
||||
|
||||
void open();
|
||||
}
|
||||
@@ -9,12 +9,11 @@ import com.mogo.och.taxi.passenger.ui.leftmenu.OverlayLeftViewUtils;
|
||||
public class OrderServiceImpl extends ILeftMenuService.Stub {
|
||||
|
||||
@Override
|
||||
public boolean transmission(int x, int action) throws RemoteException {
|
||||
return LeftMenuOpen.INSTANCE.dragAndOpen(x,action);
|
||||
public void transmissionIndex(int index) throws RemoteException {
|
||||
|
||||
UiThreadHandler.getsUiHandler().post(() -> {
|
||||
OverlayLeftViewUtils.INSTANCE.transmissionIndexGet(index);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open() throws RemoteException {
|
||||
UiThreadHandler.getsUiHandler().post(() -> OverlayLeftViewUtils.INSTANCE.open());
|
||||
}
|
||||
}
|
||||
@@ -98,6 +98,8 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
}else {
|
||||
switchVRFlatMode(false);
|
||||
}
|
||||
//预加载视频进程
|
||||
VideoActivity.Companion.startActivity(getContext(),VideoActivity.VIDEOTYPE_CLOSE);
|
||||
}
|
||||
|
||||
private void updateSwitchMapIcon(){
|
||||
@@ -131,7 +133,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
findViewById(R.id.iv_temp).setOnClickListener(view -> {
|
||||
OverlayLeftViewUtils.INSTANCE.showOverlayView(getActivity());
|
||||
OverlayLeftViewUtils.INSTANCE.addDragTarget(vOpenLeft);
|
||||
VideoActivity.Companion.startActivity(getContext(),VideoActivity.VIDEOTYPE_CLOSE);
|
||||
//showOrHideArrivedEndLayout(true, "北京北京北京", "1527481606997577728");
|
||||
//showOrHidePressengerCheckPager(true, "开始站点开", "开始站点开始站点开始", "2", "京A888888", "18811539480");
|
||||
//OCHFloatWindowManager.getInstance().ShowFloatWindow(getContext());
|
||||
|
||||
@@ -3,9 +3,6 @@ package com.mogo.och.taxi.passenger.ui.leftmenu
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
|
||||
class ItemViewTouchListener :
|
||||
View.OnTouchListener {
|
||||
@@ -15,16 +12,16 @@ class ItemViewTouchListener :
|
||||
override fun onTouch(view: View, motionEvent: MotionEvent): Boolean {
|
||||
when (motionEvent.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
LeftMenuOpen.dragAndOpenOwnProcess(motionEvent.rawX.toInt(),motionEvent.action)
|
||||
LeftMenuOpen.dragAndOpen(motionEvent.rawX.toInt(),motionEvent.action)
|
||||
dragTime = System.currentTimeMillis()
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
if (LeftMenuOpen.dragAndOpenOwnProcess(motionEvent.rawX.toInt(),motionEvent.action)) {
|
||||
if (LeftMenuOpen.dragAndOpen(motionEvent.rawX.toInt(),motionEvent.action)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
MotionEvent.ACTION_UP -> {
|
||||
LeftMenuOpen.dragAndOpenOwnProcess(motionEvent.rawX.toInt(),motionEvent.action)
|
||||
LeftMenuOpen.dragAndOpen(motionEvent.rawX.toInt(),motionEvent.action)
|
||||
if (System.currentTimeMillis() - dragTime > 500) {
|
||||
dragTime = 0
|
||||
return true
|
||||
|
||||
@@ -31,7 +31,6 @@ object LeftMenuOpen {
|
||||
|
||||
private var orderService: ILeftMenuService? = null
|
||||
|
||||
// 主进程
|
||||
fun setValue(
|
||||
windowView: View,
|
||||
wl: WindowManager.LayoutParams?,
|
||||
@@ -50,7 +49,6 @@ object LeftMenuOpen {
|
||||
registerC()
|
||||
}
|
||||
|
||||
// 主进程
|
||||
fun clearValue() {
|
||||
this.open = null
|
||||
this.close = null
|
||||
@@ -76,13 +74,6 @@ object LeftMenuOpen {
|
||||
private const val DEVIATION = 10
|
||||
private const val NEGATIVEDEVIATION = -10
|
||||
|
||||
fun dragAndOpenOwnProcess(newX: Int, action: Int): Boolean {
|
||||
return orderService?.transmission(newX, action) ?: false
|
||||
}
|
||||
|
||||
/**
|
||||
* binder 会自动判断进程
|
||||
*/
|
||||
fun dragAndOpen(newX: Int, action: Int): Boolean {
|
||||
when (action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
@@ -166,7 +157,7 @@ object LeftMenuOpen {
|
||||
}
|
||||
view.setOnTouchListener(ItemViewTouchListener())
|
||||
view.setOnClickListener {
|
||||
orderService?.open()
|
||||
open?.let { it1 -> it1(windowView!!, windowManager) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,6 +170,13 @@ object LeftMenuOpen {
|
||||
}
|
||||
}
|
||||
|
||||
fun transmissionIndex(index:Int){
|
||||
if (orderService == null) {
|
||||
registerC()
|
||||
}
|
||||
orderService?.transmissionIndex(index)
|
||||
}
|
||||
|
||||
/**
|
||||
* 主进程、video进程都得调用
|
||||
* 主进程在显示是主动调用
|
||||
|
||||
@@ -30,26 +30,31 @@ class ListAdapter(private val context: Context,val list: MutableList<LeftMenuMod
|
||||
imageView.setImageResource(leftMenuModel.select)
|
||||
}
|
||||
imageView.setOnClickListener {
|
||||
for (i in list.indices) {
|
||||
if(position==i){
|
||||
if(!list[i].isChecked){
|
||||
list[i].selectListener.onSelect(convertView)
|
||||
}
|
||||
}
|
||||
list[i].isChecked = position == i
|
||||
}
|
||||
notifyDataSetChanged()
|
||||
setSelectIndex(position,true)
|
||||
}
|
||||
return imageView
|
||||
}
|
||||
|
||||
/**
|
||||
* 多进程调用
|
||||
*/
|
||||
fun setSelectIndex(index: Int,needStartActivity: Boolean) {
|
||||
for (i in list.indices) {
|
||||
if(index==i){
|
||||
if(!list[i].isChecked){
|
||||
if(needStartActivity) {
|
||||
list[i].selectListener.onSelect()
|
||||
}
|
||||
OverlayLeftViewUtils.transmissionIndex(index)
|
||||
}
|
||||
}
|
||||
list[i].isChecked = index == i
|
||||
}
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
interface OnTabSelectListener {
|
||||
/**
|
||||
* Called when a view has been clicked.
|
||||
*
|
||||
* @param v The view that was clicked.
|
||||
*/
|
||||
fun onSelect(v: View?)
|
||||
fun onSelect()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import android.animation.ValueAnimator
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.Context.WINDOW_SERVICE
|
||||
import android.content.Intent
|
||||
import android.graphics.PixelFormat
|
||||
import android.view.Gravity
|
||||
@@ -15,9 +16,6 @@ import android.view.animation.LinearInterpolator
|
||||
import android.widget.ListView
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.IAppStateListener
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.ui.leftmenu.model.LeftMenuModel
|
||||
import com.mogo.och.taxi.passenger.ui.video.VideoActivity
|
||||
@@ -35,7 +33,6 @@ import java.util.concurrent.TimeUnit
|
||||
object OverlayLeftViewUtils {
|
||||
private const val TAG = "OverlayViewUtils"
|
||||
private var windowManager: WindowManager? = null
|
||||
private var applicationContext: Context? = null
|
||||
|
||||
@Volatile
|
||||
private var isShowing = false
|
||||
@@ -45,6 +42,10 @@ object OverlayLeftViewUtils {
|
||||
const val WIDTH = 810
|
||||
const val DEVIATION_WIDTH = -669
|
||||
|
||||
const val LIVE = 0
|
||||
const val CONSULT = 1
|
||||
const val MOVIE = 2
|
||||
|
||||
|
||||
private var overlayView: View?=null
|
||||
|
||||
@@ -52,33 +53,16 @@ object OverlayLeftViewUtils {
|
||||
|
||||
private var acivOpenClose: AppCompatImageView?=null
|
||||
|
||||
private val appStatesListener = object : IAppStateListener {
|
||||
override fun onAppStateChanged(isForeground: Boolean) {
|
||||
if (isForeground) {
|
||||
CallerLogger.d("FinalizeCrashFixer", "--- 切换到前台 ---")
|
||||
} else {
|
||||
CallerLogger.d("FinalizeCrashFixer", "--- 切换到后台 ---")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加覆盖View在Activity上面
|
||||
*/
|
||||
@JvmOverloads
|
||||
fun showOverlayView(context: Activity, ani: Int = -1) {
|
||||
if (!ProcessUtils.isMainProcess(context)) {
|
||||
// 只有主进程可以启动
|
||||
return
|
||||
}
|
||||
fun showOverlayView(context: Activity,checkIndex:Int = LIVE,isOpen: Boolean=true, ani: Int = -1) {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
if (applicationContext == null) {
|
||||
applicationContext = context.applicationContext
|
||||
}
|
||||
if (windowManager == null) {
|
||||
windowManager = context.windowManager
|
||||
windowManager = context.getSystemService(WINDOW_SERVICE) as WindowManager
|
||||
}
|
||||
|
||||
overlayView = LayoutInflater.from(context)
|
||||
@@ -90,7 +74,7 @@ object OverlayLeftViewUtils {
|
||||
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)
|
||||
layoutParams(ani,view)
|
||||
layoutParams(ani,view, isOpen)
|
||||
|
||||
// 如果正在展示中,并且lastOverlayView不为null,先做移除操作,保证覆盖在最上面的View只有一个,防止叠加导致无法移除
|
||||
dismissOverlayView()
|
||||
@@ -111,32 +95,34 @@ object OverlayLeftViewUtils {
|
||||
val integers = mutableListOf<LeftMenuModel>()
|
||||
|
||||
val liveSelected = object :ListAdapter.OnTabSelectListener{
|
||||
override fun onSelect(v: View?) {
|
||||
override fun onSelect() {
|
||||
close(view, windowManager)
|
||||
VideoActivity.startActivity(context,VideoActivity.VIDEOTYPE_CLOSE)
|
||||
}
|
||||
}
|
||||
|
||||
val consultSelect = object :ListAdapter.OnTabSelectListener{
|
||||
override fun onSelect(v: View?) {
|
||||
override fun onSelect() {
|
||||
close(view, windowManager)
|
||||
VideoActivity.startActivity(context,VideoActivity.VIDEOTYPE_CONSULT)
|
||||
}
|
||||
}
|
||||
|
||||
val entertainmentSelect = object :ListAdapter.OnTabSelectListener{
|
||||
override fun onSelect(v: View?) {
|
||||
override fun onSelect() {
|
||||
close(view, windowManager)
|
||||
VideoActivity.startActivity(context,VideoActivity.VIDEOTYPE_MOIES)
|
||||
}
|
||||
}
|
||||
|
||||
integers.add(LeftMenuModel(R.drawable.taxi_p_mogo_live_select,R.drawable.taxi_p_mogo_live_selected,true,liveSelected))
|
||||
integers.add(LeftMenuModel(R.drawable.taxi_p_mogo_live_select,R.drawable.taxi_p_mogo_live_selected,false,liveSelected))
|
||||
integers.add(LeftMenuModel(R.drawable.taxi_p_mogo_consult_select,R.drawable.taxi_p_mogo_consult_selected,false,consultSelect))
|
||||
integers.add(LeftMenuModel(R.drawable.taxi_p_mogo_entertainment_select,R.drawable.taxi_p_mogo_entertainment_selected,false,entertainmentSelect))
|
||||
integers.forEachIndexed { index, leftMenuModel ->
|
||||
leftMenuModel.isChecked = index == checkIndex
|
||||
}
|
||||
lvSelectItem.adapter = ListAdapter(context, integers)
|
||||
|
||||
//AppStateManager.registerAppStateListener(appStatesListener)
|
||||
LeftMenuOpen.setValue(view, params, windowManager,::close,::open)
|
||||
try {
|
||||
windowManager!!.addView(overlayView, params)
|
||||
@@ -178,12 +164,6 @@ object OverlayLeftViewUtils {
|
||||
valueAnimator.start()
|
||||
}
|
||||
|
||||
fun open(){
|
||||
if(isShowing) {
|
||||
overlayView?.let { open(it, windowManager) }
|
||||
}
|
||||
}
|
||||
|
||||
fun addDragTarget(view :View?){
|
||||
LeftMenuOpen.registerDragView(view)
|
||||
}
|
||||
@@ -192,6 +172,22 @@ object OverlayLeftViewUtils {
|
||||
LeftMenuOpen.unRegisterDragView(view)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
fun transmissionIndex(index:Int){
|
||||
LeftMenuOpen.transmissionIndex(index)
|
||||
}
|
||||
|
||||
fun transmissionIndexGet(index: Int){
|
||||
overlayView?.let {
|
||||
val lvSelectItem = it.findViewById<ListView>(R.id.lv_select_item)
|
||||
val listAdapter = lvSelectItem.adapter as ListAdapter
|
||||
listAdapter.setSelectIndex(index,false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun closeByTime(
|
||||
overlayView: View,
|
||||
windowManager: WindowManager?
|
||||
@@ -218,8 +214,10 @@ object OverlayLeftViewUtils {
|
||||
valueAnimator.duration = 100
|
||||
valueAnimator.interpolator = LinearInterpolator()
|
||||
valueAnimator.addUpdateListener {
|
||||
params?.x = it.animatedValue as Int
|
||||
windowManager?.updateViewLayout(overlayView, params)
|
||||
params?.let { paramsIn->
|
||||
paramsIn.x = it.animatedValue as Int
|
||||
windowManager?.updateViewLayout(overlayView, paramsIn)
|
||||
}
|
||||
}
|
||||
valueAnimator.addListener(object : Animator.AnimatorListener {
|
||||
override fun onAnimationStart(animation: Animator?) {}
|
||||
@@ -229,11 +227,14 @@ object OverlayLeftViewUtils {
|
||||
pivotY = (height /2).toFloat()
|
||||
rotation = 180f
|
||||
}
|
||||
params?.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
|
||||
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS or
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE or
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||
windowManager?.updateViewLayout(overlayView, params)
|
||||
params?.let {
|
||||
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
|
||||
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS or
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE or
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||
windowManager?.updateViewLayout(overlayView, it)
|
||||
}
|
||||
|
||||
}
|
||||
override fun onAnimationCancel(animation: Animator?) {}
|
||||
override fun onAnimationRepeat(animation: Animator?) {}
|
||||
@@ -241,20 +242,25 @@ object OverlayLeftViewUtils {
|
||||
valueAnimator.start()
|
||||
}
|
||||
|
||||
private fun layoutParams(ani: Int,view :View) {
|
||||
private fun layoutParams(ani: Int,view :View,isOpen: Boolean) {
|
||||
if(params ==null) {
|
||||
params = WindowManager.LayoutParams()
|
||||
}
|
||||
params = WindowManager.LayoutParams()
|
||||
params?.let {
|
||||
it.width = WIDTH
|
||||
it.height = WindowManager.LayoutParams.MATCH_PARENT
|
||||
it.alpha = 1.0f
|
||||
it.gravity = Gravity.START or Gravity.CENTER_HORIZONTAL
|
||||
it.x = 0
|
||||
if(isOpen) {
|
||||
it.x = 0
|
||||
}else{
|
||||
it.x = DEVIATION_WIDTH
|
||||
}
|
||||
it.y = 0
|
||||
it.format = PixelFormat.RGBA_8888
|
||||
// 设置窗口类型为应用子窗口,和PopupWindow同类型
|
||||
it.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
|
||||
it.type = WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL
|
||||
// 没有边界限制,允许窗口扩展到屏幕外
|
||||
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
|
||||
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS or
|
||||
@@ -273,7 +279,6 @@ object OverlayLeftViewUtils {
|
||||
if (!isShowing) {
|
||||
return
|
||||
}
|
||||
//AppStateManager.unRegisterAppStateListener(appStatesListener)
|
||||
subscribe?.let {
|
||||
if (!it.isDisposed) {
|
||||
it.dispose()
|
||||
@@ -285,7 +290,9 @@ object OverlayLeftViewUtils {
|
||||
LeftMenuOpen.clearValue()
|
||||
try {
|
||||
if (windowManager != null && overlayView != null) {
|
||||
windowManager!!.removeView(overlayView)
|
||||
windowManager!!.removeViewImmediate(overlayView)
|
||||
windowManager = null
|
||||
params = null
|
||||
}
|
||||
if (overlayView!=null) {
|
||||
overlayView = null
|
||||
|
||||
@@ -17,7 +17,6 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.bumptech.glide.request.target.SimpleTarget
|
||||
import com.bumptech.glide.request.transition.Transition
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerVideoPlay
|
||||
@@ -54,7 +53,6 @@ class VideoActivity : AppCompatActivity() {
|
||||
const val VIDEOTYPE_MOIES = 1
|
||||
const val VIDEOTYPE_CLOSE = 2
|
||||
|
||||
@JvmOverloads
|
||||
fun startActivity(context:Context,videoType:Int){
|
||||
val intent = Intent(context, VideoActivity::class.java)
|
||||
intent.putExtra(VIDEOTYPE, videoType)
|
||||
@@ -192,17 +190,12 @@ class VideoActivity : AppCompatActivity() {
|
||||
if (prePlayerPosition != centerItemPosition) {
|
||||
if (player.currentState == GSYVideoView.CURRENT_STATE_PAUSE) {
|
||||
player.onVideoReset()
|
||||
} else {
|
||||
}
|
||||
val playerHolder =
|
||||
carouselLayoutManager.findViewByPosition(prePlayerPosition)
|
||||
val prePlayer =
|
||||
playerHolder?.findViewById<ConsultVideoPlayer>(R.id.video_item_player)
|
||||
prePlayer?.let {
|
||||
if (it is ConsultVideoPlayer) {
|
||||
it.onVideoReset()
|
||||
}
|
||||
}
|
||||
prePlayer?.onVideoReset()
|
||||
val taxiPassengerVideoPlay = arrayListOf[centerItemPosition]
|
||||
setBackageAndPlayNext(taxiPassengerVideoPlay, player, centerItemPosition)
|
||||
} else {
|
||||
@@ -213,7 +206,7 @@ class VideoActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
override fun pageStop() {
|
||||
val (centerItemPosition: Int, player) = getPlayer(carouselLayoutManager)
|
||||
val (_: Int, player) = getPlayer(carouselLayoutManager)
|
||||
if (player is ConsultVideoPlayer) {
|
||||
player.onVideoPause()
|
||||
}
|
||||
@@ -233,7 +226,7 @@ class VideoActivity : AppCompatActivity() {
|
||||
indicatorView.onPageScrolled(currentIndex, fl, 0)
|
||||
}
|
||||
recyclerVideoAdapter.setOnThumbImageClilckListener {
|
||||
val (centerItemPosition: Int, player) = getPlayer(carouselLayoutManager)
|
||||
val (_: Int, player) = getPlayer(carouselLayoutManager)
|
||||
if (player is ConsultVideoPlayer) {
|
||||
player.onVideoReset()
|
||||
player.thumbImageViewLayout.visibility = View.VISIBLE
|
||||
@@ -319,32 +312,41 @@ class VideoActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
when (videotype){
|
||||
VIDEOTYPE_CONSULT -> {
|
||||
OverlayLeftViewUtils.showOverlayView(this,isOpen = false, checkIndex = OverlayLeftViewUtils.CONSULT)
|
||||
}
|
||||
VIDEOTYPE_MOIES -> {
|
||||
OverlayLeftViewUtils.showOverlayView(this,isOpen = false, checkIndex = OverlayLeftViewUtils.MOVIE)
|
||||
}
|
||||
}
|
||||
OverlayLeftViewUtils.addDragTarget(vOpenLeft)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
val carouselLayoutManager = rvVideoPlaylist?.layoutManager as CarouselLayoutManager
|
||||
val (centerItemPosition: Int, player) = getPlayer(carouselLayoutManager)
|
||||
player?.let {
|
||||
if (player is ConsultVideoPlayer) {
|
||||
if (player.isIfCurrentIsFullscreen) {// 全屏了
|
||||
|
||||
// 恢复播放和开始播放
|
||||
if (player.isIfCurrentIsFullscreen) {// 全屏了
|
||||
|
||||
} else {
|
||||
when (player.currentState) {
|
||||
GSYVideoView.CURRENT_STATE_PAUSE -> {
|
||||
player.onVideoResume(false)
|
||||
}
|
||||
GSYVideoView.CURRENT_STATE_PLAYING -> {
|
||||
}
|
||||
else -> {
|
||||
val recyclerVideoAdapter =
|
||||
rvVideoPlaylist?.adapter as RecyclerVideoAdapter
|
||||
setBackageAndPlayNext(
|
||||
recyclerVideoAdapter.getItemByPosition(centerItemPosition),
|
||||
player, centerItemPosition
|
||||
)
|
||||
//player.startPlayLogic()
|
||||
}
|
||||
} else {
|
||||
when (player.currentState) {
|
||||
GSYVideoView.CURRENT_STATE_PAUSE -> {
|
||||
player.onVideoResume(false)
|
||||
}
|
||||
GSYVideoView.CURRENT_STATE_PLAYING -> {
|
||||
}
|
||||
else -> {
|
||||
val recyclerVideoAdapter =
|
||||
rvVideoPlaylist?.adapter as RecyclerVideoAdapter
|
||||
setBackageAndPlayNext(
|
||||
recyclerVideoAdapter.getItemByPosition(centerItemPosition),
|
||||
player, centerItemPosition
|
||||
)
|
||||
//player.startPlayLogic()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -372,6 +374,7 @@ class VideoActivity : AppCompatActivity() {
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
releaseOnNewInstance()
|
||||
OverlayLeftViewUtils.dismissOverlayView()
|
||||
}
|
||||
|
||||
private fun releaseOnNewInstance() {
|
||||
@@ -387,4 +390,6 @@ class VideoActivity : AppCompatActivity() {
|
||||
OverlayLeftViewUtils.removeDragTarget(vOpenLeft)
|
||||
}
|
||||
|
||||
override fun onBackPressed() {}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user