New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event for RTCRtpSender.replaceTrack #2601
Comments
There isn’t one, but it returns a promise. |
@henbos Thanks for your reply! For example: RTCRtpSender.replaceTrack(mytrack) Receiver listen to the track replacement: RTCRtpReceiver.onreplacetrack = () => {
// do something when sender replaced the track
} Thanks |
I see, strictly speaking that does not exist either. And with regards to replacing one track with another track, you'll just change what frames are being sent, but nothing is negotiated to tell the other endpoint that the track was replaced. However, you can start or stop the transmission if you are using replaceTrack(null) and replaceTrack(track), which is different from enabling or disabling the track that is being sent - as that just replaces the content with black frames. RTCRtpSender.track:
But so what happens if we start or stop sending?
You should not expect to see an RTCP BYE, this only happens when the transmission ends permanently (e.g. RTCRtpTransceiver.stop()). But you should expect to see onmute fire after a timeout and onunmute to happen when receiving packets again. However...
|
There is, however, RTCRtpReceiver.getContributingSources()[i].timestamp, which will tell you what time you last received an RTP packet. That might help you, but again, how could you tell if packets are not arriving due to replaceTrack() or due to a network disruption? |
There is absolutely no sign on the receiver side that ReplaceTrack has happened; that was part of the design of ReplaceTrack. |
Hi team, I couldn't find any event to listen to a
RTCRtpSender.replaceTrack
. Is there any option available to listen to that?The text was updated successfully, but these errors were encountered: