MultiRtpDisplay
Created by pedro, HirogaKatageri on 2021-05-24. Experimental Class. It supports multiple streams of rtmp and rtsp at same time. You must set the same number of ConnectChecker that you want use. For example. 2 RTMP and 1 RTSP: stream1, stream2, stream3 (stream1 and stream2 are ConnectCheckerRtmp. stream3 is ConnectCheckerRtsp) MultiRtpDisplay multiRtpDisplay = new MultiRtpDisplay(context, true, new ConnectCheckerRtmp[]{ stream1, stream2 }, new ConnectCheckerRtsp[]{ stream3 }); You can set an empty array or null if you don't want to use a specific protocol. new MultiRtpDisplay(context, true, new ConnectCheckerRtmp[]{ stream1, stream2 }, null); // RTSP protocol is not used In order to use start, stop and other calls you must send type of stream and index to execute it. Example (using previous example interfaces): multiRtpDisplay.startStream(RtpType.RTMP, 1, url); //stream2 is started multiRtpDisplay.stopStream(RtpType.RTSP, 0); //stream3 is stopped multiRtpDisplay.retry(RtpType.RTMP, 0, delay, reason, backupUrl) //retry stream1 NOTE: If you call these methods nothing is executed: multiRtpDisplay.startStream(endpoint); multiRtpDisplay.stopStream(); multiRtpDisplay.retry(delay, reason, backUpUrl); The rest of methods without RtpType and index means that you will execute that command in all streams. Read class code if you need info about any method.