在surfaceDestroyed裡面呼叫pause

This commit is contained in:
Raymond Yang
2023-03-08 13:37:26 +08:00
parent 975e2eba79
commit c9ca4156aa
5 changed files with 9 additions and 28 deletions
@@ -31,7 +31,7 @@ class GstLibrary(context: Context) : Closeable, SurfaceHolder.Callback {
nativePlay()
}
fun stop() {
fun pause() {
if (!isInit) return
nativePause()
}
@@ -139,6 +139,7 @@ class GstLibrary(context: Context) : Closeable, SurfaceHolder.Callback {
override fun surfaceDestroyed(holder: SurfaceHolder) {
Log.d("$TAG+$tag", "Surface destroyed")
pause()
releaseSurface()
isInit = false
}