Skip to content

Reconnect RtspDisplay #2000

@KuboCh

Description

@KuboCh

Hi Pedro,
I'm implementing screen sharing using your your library, I'm using RtspDisplay for streaming to go2rtc server and I have two issues I’d like clarification on, if you can help me:

  1. How to properly reconnect a stream without stopping the MediaProjection / VirtualDisplay?
    In my current implementation, whenever I call: rtspDisplay.stopStream() as part of a reconnection attempt, the library destroys the underlying VirtualDisplay and MediaProjection is also stopped. This causes the MediaProjection session to expire on android 14+, and on many devices it immediately triggers the system dialog asking the user to grant screen-sharing permission again.
    Is there a recommended way to reconnect (restart encoders / RTSP client) without destroying the VirtualDisplay and causing MediaProjection to stop?
    I tried rtspDisplay.streamClient.reTry(0, "") but stream is not reconnecting with this code.

  2. Does the library support Android 13+ "Share this app only" / partial app capture?
    When the user chooses Share this app only, the stream starts, but the encoder receives only black frames. No actual content from the window appears.

If you need logs, code excerpts, or test cases, I can provide them.
Thank you for your great work on the library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions