狀態加上緩衝中
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user