How to enable the reconnection function after playing RTSP and disconnecting the video stream

How to enable the reconnection function after playing RTSP and disconnecting the video stream.

You stop the pipeline and restart it if camera url does not change.