在surface create時,呼叫gstLibrary.setSurfaceHolder(holder)

This commit is contained in:
Raymond Yang 2023-02-01 14:48:37 +08:00
parent db673d3553
commit de152da749
2 changed files with 4 additions and 1 deletions

View File

@ -55,8 +55,8 @@ class SplitViewFragment : Fragment() {
}
override fun onPause() {
super.onPause()
stopAll()
super.onPause()
Log.d("${TAG}_$mPageNum", "onPause()")
}

View File

@ -120,6 +120,9 @@ class VideoView : ConstraintLayout, SurfaceHolder.Callback, GstCallback {
override fun surfaceCreated(holder: SurfaceHolder) {
Log.d("${TAG}_$tag", "Surface created: " + holder.surface)
if (this::gstLibrary.isInitialized) {
gstLibrary.setSurfaceHolder(holder)
}
}
override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {