AgoraIO-Extensions / agora-rtc-react

Agora RTC React SDK
https://agoraio-extensions.github.io/agora-rtc-react/
MIT License
31 stars 11 forks source link

LocalUser Vs. LocalVideoTrack #106

Closed divanov11 closed 1 year ago

divanov11 commented 1 year ago

What kind of problem do you need help?

As I understand it, it is recommended we use the LocalVideoTrack component instead of the LocalUser component. If that is so, Will LocalVideoTrack support properties such as:

If not, how else can we achieve tasks such as muting camera and mic, and setting the cover image?

hyrious commented 1 year ago

<LocalVideoTrack> is a low level component which only holds the video player (i.e. a <div>) and take responsibility to play or stop a local video track. So it does not control the microphone nor display a cover image. We believe providing this fine-grained API could let users construct any layout as they want, including the <LocalUser>.

This repo also provides examples about using these components, some common practices (like displaying a local user and render controls) are in another folder. As you can see the implementation is quite simple using these low level APIs.

guoxianzhe commented 1 year ago

@divanov11, as hyrious mentioned, <LocalVideoTrack> is a low level Component. agora-rtc-react is the core and there is no plan to provide more complex components. However, we are happy to consider that as uikit in agora-rtc-react-ui, please look forward to our future updates.