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

Detect embedded webview on iPadOS. #280

Merged
merged 2 commits into from
Oct 21, 2023

Conversation

bclark-videra
Copy link
Contributor

iPadOS identifies as Mac OS, but ua-parser-js does the extra detection to determine if it's an iPad. Use the device model to detect when we're in an embedded webview on iPadOS.

Also removes the version check for best effort webkit detection as iPadOS sends version 10.15 and checking RTCRtpTransceiver should be sufficient without the version check.

iPadOS identifies as Mac OS, but ua-parser-js does the extra detection
to determine if it's an iPad. Use the device model to detect when we're
in an embedded webview on iPadOS.

Also removes the version check for best effort webkit detection as
iPadOS sends version 10.15 and checking RTCRtpTransceiver should be
sufficient without the version check.
@bclark-videra
Copy link
Contributor Author

Debug log from device detection from an embedded WKWebView on iPadOS without this change:

[Info] mediasoup-client:Device constructor() +0ms
[Info] mediasoup-client:Device detectDevice() | browser detected [ua:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko), parsed:
{ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko)", browser: {name: "WebKit", version: "605.1.15", major: "605"}, engine: {name: "WebKit", version: "605.1.15"}, os: {name: "Mac OS", version: "10.15.6"}, device: {vendor: "Apple", model: "iPad", type: "tablet"}, …}
] +3ms
[Warning] mediasoup-client:WARN:Device detectDevice() | browser not supported [name:webkit, version:605] +0ms

src/Device.ts Outdated Show resolved Hide resolved
@@ -188,7 +190,6 @@ export function detectDevice(): BuiltinHandlerName | undefined
else if (
engineName === 'webkit' &&
isIOS &&
osVersion >= 14.3 &&
Copy link
Member

Choose a reason for hiding this comment

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

I understand this is not super required, but what is wrong with it? Is this version requirement generating some issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, iPadOS WKWebView reports as OS Version 10.15.

Co-authored-by: Iñaki Baz Castillo <[email protected]>
@ibc
Copy link
Member

ibc commented Oct 6, 2023

Thanks, I'll merge and release next Monday or before if I can.

@ibc ibc merged commit df36b1c into versatica:v3 Oct 21, 2023
@ibc
Copy link
Member

ibc commented Oct 21, 2023

Sorry for the delay. Released in 3.6.102.

@bclark-videra
Copy link
Contributor Author

Sorry for the delay. Released in 3.6.102.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants