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

Add fallback for addTrack if addTransceiver is not supported by a device #403

Merged
merged 7 commits into from
Aug 19, 2022

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Aug 18, 2022

the work in this PR is largely based upon the work in #373 (thank you @cscherban !)
main difference implementation wise is that there's no support for addStream.
apart from that it's mostly refactoring.

To increase compatibility further, we will have to add some more specific browser targets to the babel transpilation (will open a separate PR for that).

note: using addTrack currently breaks dynacast as this check is failing https://github.com/livekit/client-sdk-js/blob/main/src/room/track/LocalVideoTrack.ts#L322

@changeset-bot
Copy link

changeset-bot bot commented Aug 18, 2022

🦋 Changeset detected

Latest commit: 97b14d1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
livekit-client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

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

This is a great cleanup!

return this.createTransceiverRTCRtpSender(track, opts, encodings);
}
if (supportsAddTrack()) {
console.log('using add-track fallback');
Copy link
Member

Choose a reason for hiding this comment

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

switch to our logger?

@@ -577,7 +567,7 @@ export default class LocalParticipant extends Participant {
this.engine.negotiate();

// store RTPSender
track.sender = transceiver.sender;
track.sender = await this.engine.createSender(track, opts, encodings);
Copy link
Member

Choose a reason for hiding this comment

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

I think this will need to happen before this.engine.negotiate() and setTrackCodecBitrate. tho today this works because of the debounce logic that we have in place.

@lukasIO lukasIO merged commit fb2b221 into main Aug 19, 2022
@lukasIO lukasIO deleted the lukas/add-track-fallback branch August 19, 2022 10:23
@github-actions github-actions bot mentioned this pull request Aug 19, 2022
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