-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: separate API for enabled and muted states #72
Conversation
src/media/stream.ts
Outdated
@@ -5,8 +5,15 @@ export enum StreamEventNames { | |||
Ended = 'stream-ended', | |||
} | |||
|
|||
export enum MuteStateChangeReason { |
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.
A bit of a nitpick, but I wonder if we should re-phrase this as "MuteStateChangeSource" and the values be more "plain nouns" (User
, Browser
).
/** | ||
* @inheritdoc | ||
*/ | ||
protected addTrackHandlers(track: MediaStreamTrack): 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.
what happens when RemoteStream.replaceTrack()
is called and the previous track was muted, but the new one isn't. Should we emit the MediaStateChange event?
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.
There's no "mute" for remote (something we're trying to correct with new vocabulary), but I think this point still stands in that the media states could differ...maybe we need to compare the old and new states at replacement time.
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.
That's a good point. Yeah, I think we should.
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.
lgtm, but let's figure out @marcin-bazyl 's question
# [2.6.0](v2.5.0...v2.6.0) (2024-03-12) ### Features * separate API for enabled and muted states ([#72](#72)) ([f4ce41d](f4ce41d))
This reverts commit f4ce41d.
This PR updates the mute events and getters to make it clear whether the user muted the stream or the system muted the stream as part of SPARK-493485. The main changes are:
Stream
:MuteStateChange
. This will be replaced with new events inLocalStream
/RemoteStream
.LocalStream
:UserMuteStateChange
, emits a boolean with the new user mute state.SystemMuteStateChange
, emits a boolean with the new system mute state.userMuted
/systemMuted
muted
will be inLocalStream
only, gets the overall mute state (taking into consideration bothuserMuted
andsystemMuted
)RemoteStream
:MediaStateChange
, emits either "started" or "stopped".muted
and replace with gettermediaState
, returns "started" or "stopped".