加入初始化旗標
This commit is contained in:
+4
-4
@@ -71,7 +71,7 @@ class SplitViewFragment : Fragment() {
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
//stopAll()
|
||||
stopAll()
|
||||
super.onPause()
|
||||
Log.d("${TAG}_$mPageNum", "onPause()")
|
||||
}
|
||||
@@ -201,15 +201,15 @@ class SplitViewFragment : Fragment() {
|
||||
}
|
||||
}.start()
|
||||
|
||||
fun stopAll() /*= MainScope().launch(Dispatchers.Main)*/ {
|
||||
if (videoViews.isEmpty()) return
|
||||
fun stopAll() = MainScope().launch(Dispatchers.Main) {
|
||||
if (videoViews.isEmpty()) return@launch
|
||||
for (index in data.indices) {
|
||||
videoViews[index].stopRetryCount()
|
||||
if (!videoViews[index].isPlaying || videoViews[index].isLoading) continue
|
||||
videoViews[index].stop()
|
||||
//delay(300)
|
||||
}
|
||||
}//.start()
|
||||
}.start()
|
||||
|
||||
fun destroyAll() /*= MainScope().launch(Dispatchers.Main)*/ {
|
||||
if (videoViews.isEmpty()) return
|
||||
|
||||
Reference in New Issue
Block a user