Property 'peerConnection' does not exist on type 'SessionDescriptionHandler'
See original GitHub issueHello, I got the following problem when trying to migrate from sipjs 0.15.11 to sjipjs 0.16.1. Am I missing something here?
Describe the bug Property ‘peerConnection’ does not exist on type ‘SessionDescriptionHandler’
Logs
error TS2339: Property 'peerConnection' does not exist on type 'SessionDescriptionHandler'.
To Reproduce Steps to reproduce the behavior:
- Create a user agent and handle incoming call
- Try to attach a media as mentioned here attach-media Using this code
// Assumes you have a media element on the DOM
const mediaElement = document.getElementById('mediaElement');
const remoteStream = new MediaStream();
function setupRemoteMedia(session: Session) {
session.sessionDescriptionHandler.peerConnection.getReceivers().forEach((receiver) => {
if (receiver.track) {
remoteStream.addTrack(receiver.track);
}
});
mediaElement.srcObject = remoteStream;
mediaElement.play();
}
Expected behavior Property ‘peerConnection’ should exist on type ‘SessionDescriptionHandler’
Observed behavior Compilation throws the error : Property ‘peerConnection’ does not exist on type ‘SessionDescriptionHandler’
Environment Information
- SipJS 0.16.1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
missing events + peerConnection typings · Issue #681 · onsip ...
Property 'on' does not exist on type 'SessionDescriptionHandler'. Property 'peerConnection' does not exist on type 'SessionDescriptionHandler'.
Read more >Session Description Handler - SIP.js
The WebRTC Session Description Handler is the default handler for SIP.js.
Read more >RTCPeerConnection deprecated properties not available in ...
In sl_rtc the code is using deprecated properties, ... error TS2339: Property >'onaddstream' does not exist on type 'RTCPeerConnection'.
Read more >How do I get the onaddstream event of peerconnection on 0.8 ...
peerconnection is not available right away, use addStream event instead: session.sessionDescriptionHandler.on('addStream', function() { console.log('stream ...
Read more >pc/peerconnection.cc - src - Git at Google
bool SafeSetError(webrtc::RTCErrorType type, webrtc::RTCError* error) { ... RTC_CHECK(!IsUnifiedPlan()) << "AddStream is not available with Unified Plan ".
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 Free
Top 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
I meet the same issue, and I import the SessionDescriptionHandler from ‘sip.js/lib/platform/web’ to fix it, it works well so far.
If someone should also have this problem. That’s how it worked for me:
Improvements and remarks are gladly accepted.