在surfaceDestroyed裡面呼叫pause
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user