-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
src/membraneWebRTC.ts
Outdated
|
||
/** | ||
* Called when peer was accepted. Triggered by {@link MembraneWebRTC.join} | ||
* Called when endpoint is ready. Triggered by {@link MembraneWebRTC.connect} |
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.
* Called when endpoint is ready. Triggered by {@link MembraneWebRTC.connect} | |
* Emitted when endpoint is ready. Triggered by {@link MembraneWebRTC.connect} |
src/membraneWebRTC.ts
Outdated
* Emitted each time endpoint is removed, emitted both for the local endpoint and other endpoints. | ||
*/ | ||
onPeerLeft?: (peer: Peer) => void; | ||
endpointRemoved: (endpoint: Endpoint) => void; |
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.
Shouldn't we have a proper event for a situation when the local endpoint is removed? Because with the current implementation, a client would have to store in his code what is its endpointId
, which IMO is a little bit inconvenient.
src/membraneWebRTC.ts
Outdated
}); | ||
this.sendMediaEvent(mediaEvent); | ||
}; | ||
|
||
/** | ||
* Updates the metadata for a specific track. | ||
* @param trackId - trackId (generated in addTrack) of audio or video track. | ||
* @param trackMetadata - Data about this track that other peers will receive upon joining. | ||
* @param trackMetadata - Data about this track that other endppoint will receive upon being added. |
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.
* @param trackMetadata - Data about this track that other endppoint will receive upon being added. | |
* @param trackMetadata - Data about this track that other endpoint will receive upon being added. |
src/membraneWebRTC.ts
Outdated
|
||
/** | ||
* Called when peer was accepted. Triggered by {@link MembraneWebRTC.join} | ||
* Emitted when endpoint of this peer is ready. Triggered by {@link MembraneWebRTC.connect} |
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 there should be no peer phrases in this library.
} | ||
|
||
interface TrackContextCallbacks { | ||
export interface TrackContextEvents { |
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 am not TS magician but using interface as "Enum" looks a little bit weird, or not really?
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.
Tough to say, although that's how it was done in jellyfish-ts-client
.
src/membraneWebRTC.ts
Outdated
} | ||
|
||
/** | ||
* Main class that is responsible for connecting to the RTC Engine, sending and receiving media. | ||
*/ | ||
export class MembraneWebRTC extends (EventEmitter as new () => TypedEmitter<Required<Callbacks>>) { | ||
export class MembraneWebRTC extends (EventEmitter as new () => TypedEmitter< |
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 it's a good time to change this name to something new. WebRTCEndpoint
comes to my mind 🤔
Removing peers to match changes in
membrane_rtc_engine
.Introduces many breaking changes.
Additionally:
MembraneWebRTC
completely in favour of emitted events.Matching PR in
membrane_rtc_engine
.