Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add toJSON function on RTCIceCandidate and RTCSessionDescription #701

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
Loading
from

Conversation

challenger71498
Copy link

As MDN described, RTCIceCandidate and RTCSessionDescription on the web have toJSON, whose output is its own init value.

https://developer.mozilla.org/en-US/docs/Web/API/RTCSessionDescription/toJSON
https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate/toJSON

However, node-webrtc does not implemented this yet, causing error as below:

awslabs/amazon-kinesis-video-streams-webrtc-sdk-js#115 (comment)

So I simply just put a toJSON method to them.

@Snapu
Copy link

Snapu commented Feb 24, 2022

Looks like the build failed because of quota issues? It would be nice to have this PR merged soon.

@Snapu
Copy link

Snapu commented Apr 27, 2022

@markandrus Are you going to look at this?

@richieteh94
Copy link

richieteh94 commented Sep 1, 2022

I'm facing an issue where I got RTCSessionDescription got error where toJSON is not a function when using together with amazon-kinesis-video-streams-webrtc version 2.0.0 npm please help fix this issue ASAP. This issue occurs to me where I trying to recreate a sample of https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-js/blob/master/examples/viewer.js in nodejs application

C:\xx\xx\xx\webrtc master\node_modules\amazon-kinesis-video-streams-webrtc\lib\SignalingClient.js:139
        this.sendMessage(MessageType.SDP_OFFER, sdpOffer.toJSON(), recipientClientId);
                                                         ^

TypeError: sdpOffer.toJSON is not a function
    at SignalingClient.sendSdpOffer (C:\xx\xx\xx\webrtc master\node_modules\amazon-kinesis-video-streams-webrtc\lib\SignalingClient.js:139:58)
    at RTCPeerConnection.<anonymous> (C:\xx\xx\xx\webrtc master\dist\index.js:252:42)
    at C:\xx\xx\xx\webrtc master\node_modules\wrtc\lib\eventtarget.js:37:18
    at Set.forEach (<anonymous>)
    at C:\xx\xx\xx\webrtc master\node_modules\wrtc\lib\eventtarget.js:33:15
    at processTicksAndRejections (internal/process/task_queues.js:75:11)

Update: same a goes to the https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-js/blob/master/examples/master.js

C:\xx\xx\xx\webrtc master\node_modules\amazon-kinesis-video-streams-webrtc\lib\SignalingClient.js:149
        this.sendMessage(MessageType.SDP_ANSWER, sdpAnswer.toJSON(), recipientClientId);
                                                           ^

TypeError: sdpAnswer.toJSON is not a function
    at SignalingClient.sendSdpAnswer (C:\xx\xx\xx\webrtc master\node_modules\amazon-kinesis-video-streams-webrtc\lib\SignalingClient.js:149:60)
    at RTCPeerConnection.<anonymous> (C:\xx\xx\xx\webrtc master\dist\index.js:104:46)
    at C:\xx\xx\xx\webrtc master\node_modules\wrtc\lib\eventtarget.js:37:18
    at Set.forEach (<anonymous>)
    at C:\xx\xx\xx\webrtc master\node_modules\wrtc\lib\eventtarget.js:33:15
    at processTicksAndRejections (internal/process/task_queues.js:75:11)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.