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
Contributor

@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
Contributor 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
@redexp
Copy link
Contributor Author

redexp commented Jun 13, 2024

@lminiero done

@lminiero
Copy link
Member

Please rebase your PR, as there's been a considerable refactoring of janus.js in #3377 and 493a97b

@lminiero
Copy link
Member

lminiero commented Sep 6, 2024

@redexp did you have a chance to rebase as mentioned? The PR as it is right now has a conflict.

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.

2 participants