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

webrtc-manager: Assing 'motion' contentHint to video tracks #388

Merged

Conversation

rafaellehmkuhl
Copy link
Member

It helps video content perform better on low bandwidth situations.
More on that here: https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/contentHint

Copy link
Member

@joaoantoniocardoso joaoantoniocardoso left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

const videoTracks = this.mediaStream.value.getVideoTracks().filter((t) => t.kind === 'video')
videoTracks.forEach((track) => {
if (!('contentHint' in track)) {
console.error('MediaStreamTrack contentHint attribute not supported.')
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be in the other way around ? We are checking for 'contentHint' but at the same time we are setting it nevertheless.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

We first check if the field is supported, and if not, we don't assign. Although I forgot a return there. Adding and merging.

@rafaellehmkuhl rafaellehmkuhl force-pushed the add-video-content-hint branch from c82a4e9 to da37ec6 Compare July 25, 2023 14:34
@rafaellehmkuhl rafaellehmkuhl merged commit ebb0ca5 into bluerobotics:master Jul 25, 2023
@rafaellehmkuhl rafaellehmkuhl deleted the add-video-content-hint branch July 25, 2023 14:34
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.

3 participants