Skip to content
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

Pull out all helper methods #3378

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Pull out all helper methods #3378

wants to merge 2 commits into from

Conversation

redexp
Copy link

@redexp redexp commented May 16, 2024

There three helper methods which was in init just because of using Janus.error or Janus.warn but we can pull out those log methods too with default noop values.

Also added returns of cached errors so user can do extra checks like

const err = Janus.attachMediaStream(el, stream);

if (err) {
  // ...
}

@lminiero
Copy link
Member

lminiero commented May 17, 2024

I guess it does make sense, it's static enough stuff that it can stay outside. I guess it's not a problem that isGetUserMediaAvailable is defined after listDevices which uses it, right? I'm not so sure about the return value, instead: this seems like it could be considered an inconsistency, if some methods do it and other don't (and I'd rather not modify all of them).

@redexp
Copy link
Author

redexp commented May 21, 2024

about isGetUserMediaAvailable - yes, it's not a problem.

about returning value - I'll remove it

removed `return error;` for consistency with other methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants