This message was deleted.
# helpdesk
s
This message was deleted.
a
cc @eager-zoo-16408 what’s the right way to use
useTracks
instead of
useMediaTrack
? (while we’re at it, we should update the deprecation comment with instructions)
d
we should also update the livestream example to not use any deprecated APIs. CC: @brainy-oxygen-72823
👌 1
🎉 1
e
@bulky-house-11843 Thanks for your feedback! Can you iterate what controls are missing from the
VideoTrack
components that you would need to start using it?
A possible way to get a specific track would be something like this:
Copy code
const streamTracks = 
     useTracks([Track.Source.Camera])
         .filter((trackRef) => /* Filter for desired track */);

return (
  <VideoTrack trackRef={streamTracks[0]} />
)
But I agree we have to update the examples. 👍
b
Yeah that's pretty much what I needed, to make sure the video and audo was coming from the "streamer" only to make sure all the rest watching can only interactive through chat (What I did is pretty similar to the livestream example from you guys). The snippet you paste I believe will be exactly what I need. Just wanted to make sure: does the
VideoTrack
component translate to a 1-to-1 element with the HTML
video
? I'm adding the live-streaming feature for a product but we're pretty much in the beginning for this so I just wanted to know how much power I have to customize something to be able to give some perspective to our company's designer, so the deprecated way of using
useRef
to target a video element made me very happy because I knew I could pretty much do any styling I wanted over it.
e
Yes, the VideoTrack is an HTML video element with some extra functionality. You can pass HTML attributes and styles to it as you wish. :) Implementation: here
b
Awesome! Thanks a lot for the answers!