mirror of
https://github.com/pion/webrtc.git
synced 2025-10-26 16:50:34 +08:00
Add recvonly transceiver for simulcast video
Fix one of the layers can't send back video because the transceiver is used for receiving.
This commit is contained in:
@@ -64,14 +64,18 @@ func main() {
|
|||||||
}
|
}
|
||||||
outputTracks["f"] = outputTrack
|
outputTracks["f"] = outputTrack
|
||||||
|
|
||||||
// Add this newly created track to the PeerConnection
|
if _, err = peerConnection.AddTransceiverFromKind(webrtc.RTPCodecTypeVideo, webrtc.RTPTransceiverInit{Direction: webrtc.RTPTransceiverDirectionRecvonly}); err != nil {
|
||||||
if _, err = peerConnection.AddTrack(outputTracks["q"]); err != nil {
|
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
if _, err = peerConnection.AddTrack(outputTracks["h"]); err != nil {
|
|
||||||
|
// Add this newly created track to the PeerConnection to send back video
|
||||||
|
if _, err = peerConnection.AddTransceiverFromTrack(outputTracks["q"], webrtc.RTPTransceiverInit{Direction: webrtc.RTPTransceiverDirectionSendonly}); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
if _, err = peerConnection.AddTrack(outputTracks["f"]); err != nil {
|
if _, err = peerConnection.AddTransceiverFromTrack(outputTracks["h"], webrtc.RTPTransceiverInit{Direction: webrtc.RTPTransceiverDirectionSendonly}); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
if _, err = peerConnection.AddTransceiverFromTrack(outputTracks["f"], webrtc.RTPTransceiverInit{Direction: webrtc.RTPTransceiverDirectionSendonly}); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user