狀態加上緩衝中

This commit is contained in:
Raymond Yang
2023-01-30 11:56:20 +08:00
parent 0a65a9615b
commit cdd2c3775d
3 changed files with 11 additions and 3 deletions
@@ -125,6 +125,7 @@ class VideoView : ConstraintLayout, SurfaceHolder.Callback, GstCallback {
GstStatus.PLAYING -> mHandler.sendMessage(Message().apply { what = MSG_PLAY })
GstStatus.PAUSE -> mHandler.sendMessage(Message().apply { what = MSG_PAUSE })
GstStatus.ERROR_WHEN_OPENING -> mHandler.sendMessage(Message().apply { what = MSG_PAUSE })
GstStatus.BUFFERING -> mHandler.sendMessage(Message().apply { what = MSG_BUFFERING })
else -> {}
}
Log.e("${TAG}_$tag", "onStatus: $gstStatus")
@@ -145,6 +146,10 @@ class VideoView : ConstraintLayout, SurfaceHolder.Callback, GstCallback {
isLoading = false
isPlaying = true
}
MSG_BUFFERING -> {
isLoading = true
isPlaying = true
}
}
}
}
@@ -157,6 +162,6 @@ class VideoView : ConstraintLayout, SurfaceHolder.Callback, GstCallback {
private const val MSG_PAUSE = 1
private const val MSG_PLAY = 2
private const val MSG_BUFFERING = 3
}
}