-
Notifications
You must be signed in to change notification settings - Fork 3
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
Type custom event payloads #103
Type custom event payloads #103
Conversation
d49bdf9
to
48029d5
Compare
stream, | ||
id: streamId, | ||
isLocal: false, | ||
hasAudioTrack: stream.getAudioTracks().length > 0, |
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.
unsure if this is correct... input welcome
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 this should be sufficient. It at least answers the question the prop seemingly asks hasAudioTrack
. However, the track could be disabled, meaning no audio, but I honestly dont know if that is the case event for a screenshare started without audio. I would keep 👍
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 guess semantically hasAudioTrack
would still be true in this case even if it was disabled or muted right?
But yeah, we can find out if it becomes an issue I guess
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.
Yep, we are staying true to the prop name 👍
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.
Nice! One thing I strongly recommend is to rename RoomEvent
-> RoomConnectionEvent
, to align what we have for LocalMedia -> LocalMediaEvent
stream, | ||
id: streamId, | ||
isLocal: false, | ||
hasAudioTrack: stream.getAudioTracks().length > 0, |
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 this should be sufficient. It at least answers the question the prop seemingly asks hasAudioTrack
. However, the track could be disabled, meaning no audio, but I honestly dont know if that is the case event for a screenshare started without audio. I would keep 👍
thin wrappers around CustomEvent that will enforce our payload types on the created events
c3dd0d3
to
e3503e1
Compare
Adds a thing custom event wrapper that ensures our events align with what we define in RoomEventsMap and LocalMediaEventsMap
To test
Gotchas
relies on us using
RoomEvent
|LocalMediaEvent
, so if someone comes along and adds another handler usingCustomEvent
we lose the typings...We could add a
this._dispatchRoomEvent(e: RoomEvent)
function to the class to solve this maybe?But then someone could just use
this.dispatchEvent(e)
to get around that...Maybe it's not a big deal