setScreenShareStoppedCallback static method

void setScreenShareStoppedCallback(
  1. ScreenShareStoppedCallback? callback
)

Set the callback for when screen share is stopped from the Android notification.

On Android, when the user taps "Stop Sharing" on the foreground service notification, this callback will be invoked so the app can clean up the screen share producer.

Call this before starting screen share to ensure the callback is ready.

Implementation

static void setScreenShareStoppedCallback(
    ScreenShareStoppedCallback? callback) {
  _ensureHandlerInitialized();
  _onScreenShareStopped = callback;
  debugPrint(
    'QuickRTC: Screen share stopped callback ${callback != null ? "set" : "cleared"}',
  );
}