在onPause時停止播放串流影像

This commit is contained in:
Barney 2022-08-01 11:41:19 +08:00
parent 28d152e98d
commit 735958bdb0

View File

@ -36,6 +36,15 @@ public class MainActivity extends AppCompatActivity implements GstCallback {
binding.buttonStop.setOnClickListener(view -> gstLibrary.stop());
}
@Override
protected void onPause() {
super.onPause();
if (gstLibrary != null) {
gstLibrary.stop();
}
}
@Override
protected void onDestroy() {
super.onDestroy();