0

I'm looking at the React video chat sample app with little to no coding knowledge. As I can see when running the app in localhost, all publishers will have the same structure and no elements to distinguish one from another (ID is changing on reload).

Would it be feasible to give a publisher privileged access to the session so I can highlight him in the app UI?

Many thanks in advance

AlexisVey
  • 69
  • 1
  • 9
  • Not sure what you mean by "privileged access to the session" but yes you can definitely highlight him in the UI. I would look at the React documentation for an overview on React and client side state management. Once you do that you can simply create a new stateful variable like `highlightedPublisher` and save the publisher you want to highlight in there. And when you render the publishers you can check to see if the publisher you're rendering is the same as `highlightedPublisher` and if so display some css that "highlights" it so to speak. Look at conditional css in React for how to do that. – Caleb Lawrence May 15 '21 at 20:00
  • Man I wish I were on your level. If I can better explain my problem, I would like to replicate Zoom/Teams "pin" feature where you can make one of the Publisher "highlighted" for all participants. As my skills are pretty limited, I do not know if your proposition would fix it as I do not know how to save/isolate a publisher. How can I attached data to a Publisher so I can identify him as the TO BE "highlighted" one? – AlexisVey May 16 '21 at 20:29
  • You can use `Signaling` to send data within OT session (something like "Pin stream with this Id"). Here is the sample https://github.com/opentok/opentok-react-native-samples/tree/main/Signaling – Igor May 19 '21 at 05:37

0 Answers0