AgoraIO-Community / Agora-RTC-React

A react wrapper for Agora RTC NG SDK
MIT License
92 stars 48 forks source link

createCustomVideoTrack difficult to use #15

Open keepersmith opened 3 years ago

keepersmith commented 3 years ago

Since this needs to be called outside the functional component, and it requires a MediaStreamTrack to already be in place, it does not seem to offer any functionality outside of a hard-coded track. Perhaps I am missing something, but there seems no way to pass it any sort of dynamically-created track. Is there a way?

EkaanshArora commented 3 years ago

Do you think creating a method on the returned hook to update the mediaTrack would help in your use case?

keepersmith commented 3 years ago

Hi - yes, for sure. Also, since this needs to be called outside the functional component, allow calling it without any mediaTrack (an empty config). The use case is for a user to select a video file and then stream it - so it needs to be adjustable from within a functional component to be useful.

EkaanshArora commented 3 years ago

That makes sense, let me put in some thought into the user-facing API and work on this in the next update. Might be some time as I'm working on a different project at the moment.