Skip to content

Commit

Permalink
Added docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
amalnanavati committed Jan 16, 2024
1 parent 16d1e00 commit 50b8c6a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions feedingwebapp/src/webrtc/webrtc_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

import axios from 'axios'

/**
* Creates a connection to the WebRTC signalling server defined in `server.js`.
*
* @param {Object} options
* @param {string} options.url - The URL of the WebRTC signalling server.
* @param {string} options.topic - The topic to subscribe to.
* @param {function} options.onTrackAdded - The callback to run when a track is added.
* @param {function} options.onConnectionEnd - The callback to run when the connection ends.
* @param {string} options.transceiverKind - The kind of transceiver to add to the peer connection.
* @param {Object} options.transceiverOptions - The options for the transceiver.
* @param {MediaStream} options.stream - The stream to add to the peer connection.
*
* @returns {WebRTCConnection} The WebRTC connection.
*/
export class WebRTCConnection {
constructor({ url, topic, onTrackAdded, onConnectionEnd, transceiverKind = null, transceiverOptions = null, stream = null }) {
this.url = url
Expand Down

0 comments on commit 50b8c6a

Please sign in to comment.