Skip to content

Use replaceTrack(null) for pauseUpstream#712

Merged
davidzhao merged 3 commits into
mainfrom
dz-pause-replace-null
May 25, 2023
Merged

Use replaceTrack(null) for pauseUpstream#712
davidzhao merged 3 commits into
mainfrom
dz-pause-replace-null

Conversation

@davidzhao
Copy link
Copy Markdown
Member

Previously we were creating placeholder tracks, that is not compatible with react-native.

Previously we were creating placeholder tracks, that is not compatible
with react-native.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 24, 2023

🦋 Changeset detected

Latest commit: 8c4acc6

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 24, 2023

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 82.37 KB (+0.04% 🔺)
dist/livekit-client.umd.js 85.44 KB (+0.05% 🔺)

@davidliu
Copy link
Copy Markdown
Contributor

Tested as working on RN with both iOS and Android. On Android, seemed to add a small delay (increased to about half a second) when connected to a local server, but didn't seem to increase over repeated usages and the audio/video stayed in sync.

@lukasIO
Copy link
Copy Markdown
Contributor

lukasIO commented May 24, 2023

there's a Safari issue from 2018 that might be a problem https://bugs.webkit.org/show_bug.cgi?id=184911

Only looking at the date of the fix it seems like the bug is present on Safari versions prior to 12

@davidzhao
Copy link
Copy Markdown
Member Author

@lukasIO thanks for checking on this.. do you think we should keep the existing behavior for older browsers like Safari 12?

@lukasIO
Copy link
Copy Markdown
Contributor

lukasIO commented May 24, 2023

the existing behaviour would then only apply to Safari 11.x as versions before that do not support canvas.captureStream that we use for creating the dummy video track. (https://caniuse.com/mdn-api_htmlcanvaselement_capturestream)

Alternatively we could throw an error instead when trying to use the API on Safari 11 (instead of ending the track) and declare the API to be only supported on Safari >= 12.

@davidzhao
Copy link
Copy Markdown
Member Author

I like the latter approach. will update the docstring and throw an exception < Safari 12

@davidzhao davidzhao merged commit 2ca87f0 into main May 25, 2023
@davidzhao davidzhao deleted the dz-pause-replace-null branch May 25, 2023 07:11
lukasIO added a commit that referenced this pull request May 25, 2023
lukasIO added a commit that referenced this pull request May 25, 2023
davidzhao added a commit that referenced this pull request May 26, 2023
Previously we were creating placeholder tracks, that is not compatible
with react-native.
davidzhao added a commit that referenced this pull request May 26, 2023
Previously we were creating placeholder tracks, that is not compatible
with react-native.

This is the second attempt. With the previous attempt in #712, paused tracks were not unpublished correctly.
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.

4 participants