How to check if a track is already added to a WebRTC peer connection before adding it?
I’m working on a WebRTC application where I dynamically add audio tracks to a peerConnection
after obtaining microphone permissions. I want to avoid adding duplicate tracks to prevent unnecessary signaling and offers. However, I’ve noticed that the track.id
changes each time I call getUserMedia
, making it difficult to check if a track has already been added.
How to check if a track is already added to a WebRTC peer connection before adding it?
I’m working on a WebRTC application where I dynamically add audio tracks to a peerConnection
after obtaining microphone permissions. I want to avoid adding duplicate tracks to prevent unnecessary signaling and offers. However, I’ve noticed that the track.id
changes each time I call getUserMedia
, making it difficult to check if a track has already been added.
How to check if a track is already added to a WebRTC peer connection before adding it?
I’m working on a WebRTC application where I dynamically add audio tracks to a peerConnection
after obtaining microphone permissions. I want to avoid adding duplicate tracks to prevent unnecessary signaling and offers. However, I’ve noticed that the track.id
changes each time I call getUserMedia
, making it difficult to check if a track has already been added.
Why onended event of MediaTrack is not fired?
I need to add mp3-file audio track to RtcPeerConnection.
This work fine, local computer loads mp3-file, converts it to blob,
creates Audio() object, a stream, sends it track[0], a peer listens it.
Also I need to capture onended
event of the added track, but it is not fired.
However, the same event of the created Audio is captured normally – see comments in my code.
WebRTC is adding the remote video without clicking on answer button
I am working on a WebRTC application using JavaScript and WebSockets. The issue I am encountering is that the remote video stream is being added automatically without the user clicking the “Answer” button. I need the remote video to only be added after the “Answer” button is clicked.I am using websoket to handle signaling in django framework.Any advice is acceptable,thanks in advance.
Why connectionState property of RTCPeerConnection object is not accesssible?
According to manual, RTCPeerConnection
has a property connectionState
(Indicates the current state
of the peer connection by returning one of the strings).
Link to the manual = https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection
WebRTC cannot be used normally in Windows, and the range of ports is blocked by the firewall
I am using webrtc to develop a website. When I was testing, I found that when I tested locally, I could establish a peer-to-peer connection normally, but when I tested on two PCs, the peer-to-peer connection could not be established successfully. I had to shut down the firewalls on both sides to establish a peer-to-peer connection.