Updated on 2024-07-30 GMT+08:00

Enabling Third-Party Video Streaming

You can configure third-party collection of video streams in OpenSDKConfig. The SDK does not collect video streams.

There are three callback methods:

onSetLocalVideoMirrorTypeNotify: callback called when a meeting starts. You can configure video mirroring.

onStartPushExternalVideoFrameNotify: callback called when a meeting starts. You must collect data and push streams.

onEndPushExternalVideoFrameNotify: callback called when a meeting ends. You can stop data collection.

Application Scenarios

Video streams are collected by non-standard mobile phone cameras or video streams need to be processed additionally.

Precautions

1. sdkConfig takes effect only when this configuration is passed during SDK initialization.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public class CustomPushExternalVideoFrameStrategy implements IPushExternalVideoFrameStrategy {

    private static CopyOnWriteArrayList<IPushVideoFrameNotification> pushVideoFrameNotifications = new CopyOnWriteArrayList<>();

    public static void registerPushVideoFrameListener(IPushVideoFrameNotification confResultNotification) {
        pushVideoFrameNotifications.add(confResultNotification);
    }

    public static void removePushVideoFrameListener(IPushVideoFrameNotification confResultNotification) {
        pushVideoFrameNotifications.remove(confResultNotification);
    }

    @Override
    public void onSetLocalVideoMirrorTypeNotify() {
        // Set the mirroring mode of the local video (called in the UI main thread). For details, see .
    }

    @Override
    public void onStartPushExternalVideoFrameNotify() {
        // Start third-party stream collection and push.
    }

    @Override
    public void onEndPushExternalVideoFrameNotify() {
        // Stop third-party stream collection and push.
    }
}
sdkConfig.setPushExternalVideoFrameStrategy(new CustomPushExternalVideoFrameStrategy());