Conversation
Karolk99
left a comment
There was a problem hiding this comment.
As discussed in the office, we don't need this event at the moment. Working example and setVideoQuality function instead of setTrackTargetVariant is enough for now. Also, you can add a test for switching layers and simulcast as another integration test.
| const variantLabel = (variant: Variant | null | undefined): string => { | ||
| switch (variant) { | ||
| case Variant.VARIANT_LOW: | ||
| return "Low"; | ||
| case Variant.VARIANT_MEDIUM: | ||
| return "Medium"; | ||
| case Variant.VARIANT_HIGH: | ||
| return "High"; | ||
| default: | ||
| return "N/A"; | ||
| } | ||
| }; | ||
|
|
There was a problem hiding this comment.
nitpick:
| const variantLabel = (variant: Variant | null | undefined): string => { | |
| switch (variant) { | |
| case Variant.VARIANT_LOW: | |
| return "Low"; | |
| case Variant.VARIANT_MEDIUM: | |
| return "Medium"; | |
| case Variant.VARIANT_HIGH: | |
| return "High"; | |
| default: | |
| return "N/A"; | |
| } | |
| }; | |
| const variantLabelMap: Record<Variant, string> = { | |
| [Variant.VARIANT_LOW]: "Low", | |
| [Variant.VARIANT_MEDIUM]: "Medium", | |
| [Variant.VARIANT_HIGH]: "High", | |
| }; |
| * | ||
| * @category Connection | ||
| * @group Hooks | ||
| */ |
There was a problem hiding this comment.
suggestion: i feel this hook is a bit too "low level" as for the react client. instead, i'd suggest adding a setTarget method to useCamera, useMicrophone, useScreenShare, useCustomSource` instead of introducing a new hook.
There was a problem hiding this comment.
this will mitigate the need to pass over a track id. react client users don't even get to the "track" level, the hooks handle it for themselves. what do you think?
There was a problem hiding this comment.
the thing is, we're going to be using this function wrt remote tracks, not local ones. so, as far as I understand, we'd need to extend usePeers, and you'd still need to somehow specify the video track from a given peer you want to act upon...
ofc if you see a more elegant way, I'm all ears -- my React proficiency is nonexistent
Description
webrtc-clientuseSetTargetTrackEncodinghook inreact-clientencodingChangedevent up to the client-levelMessageEventsints-clientminimal-reactexample to enable simulcast and render variant selection buttonsMotivation and Context
FCE-2938
Simulcast was deliberately disabled pending manual track selection support.
Documentation impact
Types of changes
not work as expected)