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

Fix getBitrate() #3340

Merged
merged 2 commits into from Apr 16, 2024
Merged

Fix getBitrate() #3340

merged 2 commits into from Apr 16, 2024

Conversation

avenal
Copy link
Contributor

@avenal avenal commented Mar 7, 2024

Since "mediaType" property seems deprecated as it was renamed to "kind" (https://developer.mozilla.org/en-US/docs/Web/API/RTCInboundRtpStreamStats), i would like to introduce small change in janus.js getBitrate function, so that it will return the correct values when called on iPhones and iPads

@januscla
Copy link

januscla commented Mar 7, 2024

Thanks for your contribution, @avenal! Please make sure you sign our CLA, as it's a required step before we can merge this.

@@ -3045,7 +3045,7 @@ function Janus(gatewayCallbacks) {
return;
let inStats = false;
// Check if these are statistics on incoming media
if((res.mediaType === "video" || res.id.toLowerCase().indexOf("video") > -1) &&
if((res.kind === "video" || res.id.toLowerCase().indexOf("video") > -1) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it better to keep both? Like

res.mediaType === "video" || res.kind === "video" || ...

I just want to avoid scenarios where there's still older browsers that don't support the new syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, I hope it won't be redundant as it was the only "mediaType" property used in the file.

@lminiero
Copy link
Member

Merging, thanks!

@lminiero lminiero merged commit bc04499 into meetecho:master Apr 16, 2024
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

3 participants