Skip to content

Commit 50b8c6a

Browse files
committed
Added docstring
1 parent 16d1e00 commit 50b8c6a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

feedingwebapp/src/webrtc/webrtc_helpers.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
import axios from 'axios'
44

5+
/**
6+
* Creates a connection to the WebRTC signalling server defined in `server.js`.
7+
*
8+
* @param {Object} options
9+
* @param {string} options.url - The URL of the WebRTC signalling server.
10+
* @param {string} options.topic - The topic to subscribe to.
11+
* @param {function} options.onTrackAdded - The callback to run when a track is added.
12+
* @param {function} options.onConnectionEnd - The callback to run when the connection ends.
13+
* @param {string} options.transceiverKind - The kind of transceiver to add to the peer connection.
14+
* @param {Object} options.transceiverOptions - The options for the transceiver.
15+
* @param {MediaStream} options.stream - The stream to add to the peer connection.
16+
*
17+
* @returns {WebRTCConnection} The WebRTC connection.
18+
*/
519
export class WebRTCConnection {
620
constructor({ url, topic, onTrackAdded, onConnectionEnd, transceiverKind = null, transceiverOptions = null, stream = null }) {
721
this.url = url

0 commit comments

Comments
 (0)