casting: stop video playback before disconnecting from device

This commit is contained in:
Marcus Hanestad
2025-10-22 13:26:08 +02:00
parent 7d19c2357c
commit c9ba8a09e2
@@ -90,6 +90,7 @@ class ConnectedCastingDialog(context: Context?) : AlertDialog(context) {
_buttonClose.setOnClickListener { dismiss(); }; _buttonClose.setOnClickListener { dismiss(); };
_buttonDisconnect.setOnClickListener { _buttonDisconnect.setOnClickListener {
try { try {
StateCasting.instance.stopVideo()
StateCasting.instance.activeDevice?.disconnect() StateCasting.instance.activeDevice?.disconnect()
} catch (e: Throwable) { } catch (e: Throwable) {
Logger.e(TAG, "Active device failed to disconnect: $e") Logger.e(TAG, "Active device failed to disconnect: $e")