-
Notifications
You must be signed in to change notification settings - Fork 0
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
docs: conference app with javascript sdk tutorial #232
Conversation
Deploying with Cloudflare Pages
|
content/docs/tutorials/hub-api/conference-app-with-javascript-sdk/index.md
Outdated
Show resolved
Hide resolved
} | ||
``` | ||
|
||
### Add MediaStream input to the peer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to mention about the default publishing video will be done with VP9 and SVC, and pointing out a reference document how to publish media. I need to write the documentation first about publishing video either with VP9 SVC or H264 Simulcast. Later we can refer that with the doc. So for now please create a new draft page with the title publishing media
or more relevant title, and fill it with will be updated
text.
|
||
We need to create a peer which under the hood will manage and establish the WebRTC connection automatically. By now, we are ready to establish the WebRTC connection which will connect multiple peer that communicates with each other. To establish a WebRTC connection, we need to [negotiate a WebRTC connection](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation). The negotiation flow is already configured under the hood if you are using the SDK. So, you don't need to worry about that part. | ||
|
||
What you need to do to trigger a WebRTC negotiation is by adding a local MediaStream input. We have obtained the local MediaStream earlier when we are asking the user to turn the camera and mic on using `getUserMedia()`. To add a MediaStream, you need to create a peer object and call the `peer.addStream()` method. After this, the negotiation flow will be configured automatically and you can check the peer connection status by getting the peer connection object using `peer.getPeerConnection()`. You can check the [connectionState](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/connectionState) or [iceConnectionState](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/iceConnectionState) properties from peer connection object. If the value is `connected`, then the connection has been successfully established and connected. The user has successfully joined to the room. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part, i think needs to be adjusted. Following this issue I don't think auto negotiate when add the stream is a good idea because there is a possibility that a client join a room without want to publish anything like mentioned on the issue. It's better to split addStream
and start negotiation. So when the start negotiation called, and no transceiver added to peerConnection object, then it should add new transceiver with recvonly
direction.
We need to have this tutorial ready as soon as possible in the production for the webinar. For now, I will merge the current state of the tutorial. |
Description
This PR will add a new docs tutorial under the Hub API section with the title name "Conference App with JavaScript SDK".