|
@@ -58,7 +58,6 @@ class PlayerActivity : AppCompatActivity(),
|
|
|
private var mIsManualPause = false
|
|
|
|
|
|
private var viewInsets = ViewportMetrics()
|
|
|
- private val currentIndex = -1
|
|
|
|
|
|
private val viewModel by viewModels<PlayerViewModel> {
|
|
|
PlayerViewModelFactory(
|
|
@@ -122,7 +121,9 @@ class PlayerActivity : AppCompatActivity(),
|
|
|
mImageMenu.setOnClickListener(this)
|
|
|
mSuperPlayerView.setPlayerViewCallback(this)
|
|
|
|
|
|
- mVodPlayerListView.layoutManager = LinearLayoutManager(this)
|
|
|
+ mVodPlayerListView.layoutManager = LinearLayoutManager(this).apply {
|
|
|
+ isSmoothScrollbarEnabled = true
|
|
|
+ }
|
|
|
mVodPlayerListAdapter = PlayerListAdapter(this)
|
|
|
mVodPlayerListAdapter.setOnItemClickListener(this)
|
|
|
mVodPlayerListView.adapter = mVodPlayerListAdapter
|
|
@@ -257,14 +258,13 @@ class PlayerActivity : AppCompatActivity(),
|
|
|
override fun onPlayIndex(index: Int, model: SuperPlayerModel) {
|
|
|
launch {
|
|
|
mVodPlayerListAdapter.setIndex(index)
|
|
|
+ mVodPlayerListView.smoothScrollToPosition(index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
override fun onPlayEnd() {}
|
|
|
|
|
|
- override fun onPlaying() {
|
|
|
- Log.d(TAG, "onPlaying: ")
|
|
|
- }
|
|
|
+ override fun onPlaying() {}
|
|
|
|
|
|
override fun onVerify(reason: SuperPlayerDef.VerifyReason) {
|
|
|
if (reason == SuperPlayerDef.VerifyReason.TIMEOUT) {
|
|
@@ -277,11 +277,11 @@ class PlayerActivity : AppCompatActivity(),
|
|
|
}
|
|
|
|
|
|
override fun onResumePlay() {
|
|
|
- viewModel.resumeTimer()
|
|
|
+// viewModel.resumeTimer()
|
|
|
}
|
|
|
|
|
|
override fun onPausePlay() {
|
|
|
- viewModel.pauseTimer()
|
|
|
+// viewModel.pauseTimer()
|
|
|
}
|
|
|
|
|
|
override fun onError(code: Int) {}
|