Kakao i Connect Live 커뮤니티

다대다 영상채팅은 어떻게 하는지요?

다른분도 질문을 올렸던데 정확한 답변은 없네요.
예시나 문서를 받아 볼수 있을까요?
답장이나
e-mail : [email protected]
부탁 드려요~
1:2만 되도 좋은데요…ㅠㅠ

MeshCall은 현재 stable 버전에는 없습니다.
아래와 같이 구현 하시면 N:N 통화가 가능합니다.

Remon SDK 2.3.0-beta.6 버전을 사용하시면 됩니다.
예제소스코드에는 ButterKnife가 사용됐습니다.
databinding 으로 하셔도 됩니다^^

MeshCallActivity.class

public class MeshCallActivity extends Activity {
    private static final String TAG = "MESH_LOG";
    private static final String REMON_SERVICE_ID = "SERVICEID1";
    private static final String REMON_KEY = "1234567890";

@BindView(R.id.surfRendererLocal)
SurfaceViewRenderer surfRendererLocal;
@BindView(R.id.surfRendererRemote0)
SurfaceViewRenderer surfRendererRemote0;
@BindView(R.id.surfRendererRemote1)
SurfaceViewRenderer surfRendererRemote1;
@BindView(R.id.surfRendererRemote2)
SurfaceViewRenderer surfRendererRemote2;
@BindView(R.id.surfRendererRemote3)
SurfaceViewRenderer surfRendererRemote3;

@BindView(R.id.etCall0)
EditText etCall0;
@BindView(R.id.btnConnect0)
Button btnConnect0;
@BindView(R.id.btnClose0)
Button btnClose0;
@BindView(R.id.etCall1)
EditText etCall1;
@BindView(R.id.btnConnect1)
Button btnConnect1;
@BindView(R.id.btnClose1)
Button btnClose1;
@BindView(R.id.etCall2)
EditText etCall2;
@BindView(R.id.btnConnect2)
Button btnConnect2;
@BindView(R.id.btnClose2)
Button btnClose2;
@BindView(R.id.etCall3)
EditText etCall3;
@BindView(R.id.btnConnect3)
Button btnConnect3;
@BindView(R.id.btnClose3)
Button btnClose3;

private RemonCall remonCall_Local;
private RemonCall remonCall_0;
private RemonCall remonCall_1;
private RemonCall remonCall_2;
private RemonCall remonCall_3;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setContentView(R.layout.activity_mesh_call);
    ButterKnife.bind(this);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    setRemonCalls();
    setEvent();

    createRemonLocal();
}

private RemonCall remonCalls[];
private SurfaceViewRenderer surfViews[];
private EditText etCalls[];
private Button btnConnects[];
private Button btnCloses[];
private void setRemonCalls() {
    remonCalls = new RemonCall[]{remonCall_0, remonCall_1, remonCall_2, remonCall_3};
    surfViews = new SurfaceViewRenderer[]{surfRendererRemote0, surfRendererRemote1, surfRendererRemote2, surfRendererRemote3};
    etCalls = new EditText[]{etCall0, etCall1, etCall2, etCall3};
    btnConnects = new Button[]{btnConnect0, btnConnect1, btnConnect2, btnConnect3};
    btnCloses = new Button[]{btnClose0, btnClose1, btnClose2, btnClose3};
}

private void setEvent() {
    for (int i = 0; i < btnConnects.length; i++) {
        int finalI = i;
        btnConnects[finalI].setOnClickListener(view -> runOnUiThread(() -> {
            surfViews[finalI].setEnableHardwareScaler(true);
            remonCalls[finalI] = RemonCall.builder()
                    .context(MeshCallActivity.this)
                    .remoteView(surfViews[finalI])
                    .serviceId(REMON_SERVICE_ID)
                    .key(REMON_KEY)
                    .build();

            remonCalls[finalI].connect(etCalls[finalI].getText().toString());
            remonCalls[finalI].onComplete(() -> runOnUiThread(() -> Log.i(TAG, "remonCall_" + finalI + " onComplete()")));
            remonCalls[finalI].onClose(closeType -> runOnUiThread(() -> {
                Log.i(TAG, "remonCall_" + finalI + " onClose()");
                surfViews[finalI].release();
                surfViews[finalI].clearImage();
                surfViews[finalI].invalidate();
            }));
        }));

        btnCloses[finalI].setOnClickListener(view -> runOnUiThread(() -> remonCalls[finalI].close()));
    }
}


private void createRemonLocal() {
    remonCall_Local = RemonCall.builder()
            .context(MeshCallActivity.this)
            .localView(surfRendererLocal)
            .serviceId(REMON_SERVICE_ID)
            .key(REMON_KEY)
        .build();
remonCall_Local.onInit(() -> runOnUiThread(() -> remonCall_Local.showLocalVideo()));
}
}

activity_mesh_call.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        android:layout_weight="3">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <com.remotemonster.sdk.PercentFrameLayout
                android:id="@+id/perFrameLocal"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
                <org.webrtc.SurfaceViewRenderer
                    android:id="@+id/surfRendererLocal"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />
            </com.remotemonster.sdk.PercentFrameLayout>
        <TextView
            android:background="@android:color/darker_gray"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:text="Local"/>
    </RelativeLayout>
</LinearLayout>

<!-- 0,1 -->
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:layout_weight="4">
    <RelativeLayout
        android:layout_weight="1"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <com.remotemonster.sdk.PercentFrameLayout
            android:id="@+id/perFrameRemote0"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <org.webrtc.SurfaceViewRenderer
                android:id="@+id/surfRendererRemote0"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </com.remotemonster.sdk.PercentFrameLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:background="@android:color/holo_blue_dark">
            <EditText
                android:id="@+id/etCall0"
                android:layout_weight="1"
                android:inputType="number"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
            <Button
                android:id="@+id/btnConnect0"
                android:textSize="10sp"
                android:layout_width="55dp"
                android:layout_height="wrap_content"
                android:text="Con"/>
            <Button
                android:id="@+id/btnClose0"
                android:layout_width="55dp"
                android:textSize="10sp"
                android:layout_height="wrap_content"
                android:text="Close"/>
        </LinearLayout>
    </RelativeLayout>

    <RelativeLayout
        android:layout_weight="1"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <com.remotemonster.sdk.PercentFrameLayout
            android:id="@+id/perFrameRemote1"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <org.webrtc.SurfaceViewRenderer
                android:id="@+id/surfRendererRemote1"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </com.remotemonster.sdk.PercentFrameLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:background="@android:color/holo_blue_dark">
            <EditText
                android:id="@+id/etCall1"
                android:layout_weight="1"
                android:inputType="number"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
            <Button
                android:id="@+id/btnConnect1"
                android:textSize="10sp"
                android:layout_width="55dp"
                android:layout_height="wrap_content"
                android:text="Con"/>
            <Button
                android:id="@+id/btnClose1"
                android:layout_width="55dp"
                android:textSize="10sp"
                android:layout_height="wrap_content"
                android:text="Close"/>
        </LinearLayout>
    </RelativeLayout>
</LinearLayout>

<!-- 2,3 -->
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:layout_weight="4">
    <RelativeLayout
        android:layout_weight="1"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <com.remotemonster.sdk.PercentFrameLayout
            android:id="@+id/perFrameRemote2"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <org.webrtc.SurfaceViewRenderer
                android:id="@+id/surfRendererRemote2"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </com.remotemonster.sdk.PercentFrameLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:background="@android:color/holo_blue_dark">
            <EditText
                android:id="@+id/etCall2"
                android:layout_weight="1"
                android:inputType="number"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
            <Button
                android:id="@+id/btnConnect2"
                android:textSize="10sp"
                android:layout_width="55dp"
                android:layout_height="wrap_content"
                android:text="Con"/>
            <Button
                android:id="@+id/btnClose2"
                android:layout_width="55dp"
                android:textSize="10sp"
                android:layout_height="wrap_content"
                android:text="Close"/>
        </LinearLayout>
    </RelativeLayout>

    <RelativeLayout
        android:layout_weight="1"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <com.remotemonster.sdk.PercentFrameLayout
            android:id="@+id/perFrameRemote3"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <org.webrtc.SurfaceViewRenderer
                android:id="@+id/surfRendererRemote3"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </com.remotemonster.sdk.PercentFrameLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:background="@android:color/holo_blue_dark">
            <EditText
                android:id="@+id/etCall3"
                android:layout_weight="1"
                android:inputType="number"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
            <Button
                android:id="@+id/btnConnect3"
                android:textSize="10sp"
                android:layout_width="55dp"
                android:layout_height="wrap_content"
                android:text="Con"/>
            <Button
                android:id="@+id/btnClose3"
                android:layout_width="55dp"
                android:textSize="10sp"
                android:layout_height="wrap_content"
                android:text="Close"/>
        </LinearLayout>
    </RelativeLayout>
</LinearLayout>