@@ -60,6 +60,13 @@ LRESULT CAgoraRegionConnDlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam)
6060 CString strInfo;
6161 strInfo.Format (_T (" %u joined" ), wParam);
6262 m_lstInfo.InsertString (m_lstInfo.GetCount (), strInfo);
63+ VideoCanvas canvas;
64+ canvas.uid = wParam;
65+ canvas.view = m_remoteVideoWnd.GetSafeHwnd ();
66+ canvas.renderMode = media::base::RENDER_MODE_FIT;
67+ // setup remote video in engine to the canvas.
68+ m_rtcEngine->setupRemoteVideo (canvas);
69+ m_remoteVideoWnd.SetUID (wParam);
6370 return TRUE ;
6471}
6572
@@ -220,9 +227,17 @@ BOOL CAgoraRegionConnDlg::OnInitDialog()
220227 m_localVideoWnd.Create (NULL , NULL , WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect (0 , 0 , 1 , 1 ), this , ID_BASEWND_VIDEO + 100 );
221228 RECT rcArea;
222229 m_staVideoArea.GetClientRect (&rcArea);
230+ rcArea.right = rcArea.left + (rcArea.right - rcArea.left ) / 2 ;
223231 m_localVideoWnd.MoveWindow (&rcArea);
224232 m_localVideoWnd.ShowWindow (SW_SHOW);
225233
234+ m_remoteVideoWnd.Create (NULL , NULL , WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect (0 , 0 , 1 , 1 ), this , ID_BASEWND_VIDEO + 100 );
235+ RECT rcArea2;
236+ m_staVideoArea.GetClientRect (&rcArea2);
237+ rcArea2.left = rcArea2.left + (rcArea2.right - rcArea2.left ) / 2 ;
238+ m_remoteVideoWnd.MoveWindow (&rcArea2);
239+ m_remoteVideoWnd.ShowWindow (SW_SHOW);
240+
226241 int nIndex = 0 ;
227242
228243 m_cmbAreaCode.InsertString (nIndex++, _T (" AREA_CODE_GLOBAL" ));
0 commit comments