peerConnectionAddTransceiver should allow config direction with kind option
See original GitHub issueIn Js, it allow to create receive only audio or video transceiver like:
peer.addTransceiver('audio', {
direction: 'recvonly'
});
But in react-native-webrtc it force to create new transceiver without init paramaters incase kind is set
Therefore I think react-native-webrtc should support the beheviour. It is simply by only create a transceiverInit variable like:
if (kind) {
if ([kind isEqual: @"audio"]) {
type = RTCRtpMediaTypeAudio;
} else if ([kind isEqual: @"video"]) {
type = RTCRtpMediaTypeVideo;
}
NSDictionary *initOptions = [options objectForKey:@"init"];
RTCRtpTransceiverInit *transceiverInit = [RTCRtpTransceiverInit new];
if (initOptions) {
NSString *dirrection = [initOptions objectForKey:@"direction"];
if ([dirrection isEqual: @"sendrecv"]) {
[transceiverInit setDirection:RTCRtpTransceiverDirectionSendRecv];
} else if ([dirrection isEqual: @"sendonly"]) {
[transceiverInit setDirection:RTCRtpTransceiverDirectionSendOnly];
} else if ([dirrection isEqual: @"recvonly"]) {
[transceiverInit setDirection:RTCRtpTransceiverDirectionRecvOnly];
} else if ([dirrection isEqual: @"inactive"]) {
[transceiverInit setDirection:RTCRtpTransceiverDirectionInactive];
}
}
transceiver = [peerConnection addTransceiverOfType:type init:transceiverInit];
} else if (trackId) {
Issue Analytics
- State:
- Created 10 months ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Exploring RTCRtpTransceiver. - Advancing WebRTC
Transceivers more accurately reflect the SDP-rooted network behaviors of an RTCPeerConnection. E.g. addTransceiver() (or addTrack ) now creates ...
Read more >addTransceiver woes · Issue #1662 · w3c/webrtc-pc - GitHub
addTransceiver () with kind should set the direction to recvonly. ... says its null initially and that changes only by setting a description....
Read more >Webrtc with transceivers - nterreri | Blog
A transceiver is a permanent pairing of a receiver and a sender. Receivers and senders are a plain JS abstraction over the underlying...
Read more >AddStream, AddTrack & AddTranceiver - WebRTC Course
Check out what is the best option to check audio levels of incoming audio ... Philipp: Now let's look at AddTrack versus AddTransceiver, ......
Read more >PSA: Spec-compliant Simulcast using addTransceiver API
Users can now call addTransceiver on the peer connection and specify multiple send ... Layers can be paused by setting the active attribute...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks folks! ❤️
@giangndm-bluesea Thanks for the report. This issue has been resolved with the next beta release going out soon 👍🏻