开启第三方视频推流配置
在OpenSDKConfig中配置视频流的第三方采集,sdk自身不再采集视频流
共有三个回调方法
onSetLocalVideoMirrorTypeNotify:会议开始时回调,用户可以在此设置镜像
onStartPushExternalVideoFrameNotify:会议开始时回调,用户必须要在此实现自己的数据采集并进行推流
onEndPushExternalVideoFrameNotify:会议结束时回调,用户可在此停止数据采集
使用场景
对于非标准手机摄像头采集视频流或者视频流需要额外处理的场景
注意事项
1.SDK初始化的时候必须传入这个配置sdkConfig才会生效
示例代码
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() { //设置本地视频窗口镜像模式(需要在UI主线程调用) } @Override public void onStartPushExternalVideoFrameNotify() { //开始第三方采集推流 } @Override public void onEndPushExternalVideoFrameNotify() { //停止第三方采集推流 } } sdkConfig.setPushExternalVideoFrameStrategy(new CustomPushExternalVideoFrameStrategy()); |