Commit 386e0d29 authored by jyx's avatar jyx

讯飞视频播放生命周期控制

parent 706d5c80
......@@ -74,6 +74,9 @@ class DrawNativeVideoActivity : BaseActivity(),
const val WEB_VIDEO_URL = "https://vring.kuyin123.com/friend/94aa83142f7f5c98?videoId="
}
// Video 视频播放生命周期控制
private var isVideoPlayPause = false
// 列表页面播放page
private var mCurrentPage = 0
......@@ -118,6 +121,7 @@ class DrawNativeVideoActivity : BaseActivity(),
mLayoutManager = ViewPagerLayoutManager(this, OrientationHelper.VERTICAL)
mDrawVideoAdapter = DrawVideoAdapter(this, drawDatas)
recy_draw_native.setItemViewCacheSize(1)
recy_draw_native.layoutManager = mLayoutManager
recy_draw_native.adapter = mDrawVideoAdapter
......@@ -306,8 +310,6 @@ class DrawNativeVideoActivity : BaseActivity(),
videoAdingManager.setVideoAdingListener(null)
videoAdingManager.onDestory()
releaseVideo(mCurrentPlayIndex)
super.onDestroy()
if (downloadId != -1) {
......@@ -485,4 +487,15 @@ class DrawNativeVideoActivity : BaseActivity(),
}
}
}
override fun onPause() {
super.onPause()
// 释放当前页Video
releaseVideo(0)
}
override fun onResume() {
super.onResume()
playVideo(0)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment