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

[BUG] WebKit doesn't play webm files on MacOS #18423

Closed
warrenseine opened this issue Oct 29, 2022 · 7 comments · Fixed by #20421
Closed

[BUG] WebKit doesn't play webm files on MacOS #18423

warrenseine opened this issue Oct 29, 2022 · 7 comments · Fixed by #20421
Assignees
Labels

Comments

@warrenseine
Copy link

warrenseine commented Oct 29, 2022


Triaging summary from @aslushnikov: WebKit doesn't play webm files on MacOS.


Context:

  • Playwright Version: 1.27.1
  • Operating System: macOS 12.6 on M1
  • Node.js version: 16.17
  • Browser: WebKit
## System:
 - OS: macOS 12.6
 - Memory: 214.27 MB / 32.00 GB
## Binaries:
 - Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
 - Yarn: 1.22.19 - ~/.yarn/bin/yarn
 - npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
## Languages:
 - Bash: 3.2.57 - /bin/bash

Describe the bug

The WebKit version fetched by Playwright has an unexpected user agent (reported with navigator.userAgent):

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15

In particular, I would expect Version/16.0, which I correctly get with my default Safari. With a manually installed Safari Technology Preview, I get Version/16.4.

I've tried cleaning caches and fetching it again:

$ rm -rf ~/Library/Caches/ms-playwright/webkit-*
$ npx playwright install webkit
Downloading Webkit 16.0 (playwright build v1724) - 53.9 Mb [====================] 100% 0.0s
Webkit 16.0 (playwright build v1724) downloaded to ~/Library/Caches/ms-playwright/webkit-1724

I suspect that the current build is not actually WebKit 16, but WebKit 13. I cannot be sure although WebM video playback support (don't play in this build, plays in official Safari and STP) seems to confirm it.

I've also tried forcing build 1728 (latest unreleased) to no avail.

@warrenseine
Copy link
Author

Plus, if I refer to this comment, the version used to be higher (14, at the time), so something must be wrong with the current build.

@warrenseine
Copy link
Author

warrenseine commented Oct 31, 2022

Relatedly, WebKit on Linux is reporting version 16. It does play WebM. On the other hand, it doesn't have MediaRecorder, but that's another story 🤔

To sum up, taking the latest builds on each platform:

User agent WebM playback MediaRecorder
Official Safari (macOS 12.6 arm64) Version/16.0
Safari Technology Preview (macOS 12.6 arm64) Version/16.4
Playwright WebKit v1724 (macOS 12 arm64) Version/13.0.4
Playwright WebKit v1724 (Docker v1.27.1-focal) Version/16.0

I don't know how Playwright WebKit was built. I'll have a look at the browser_patches directory, but any help would be welcome.

@aslushnikov
Copy link
Collaborator

@warrenseine how do you check the user agent?

For example, the following yields a proper user agent for me.

// a.mjs
import { webkit } from '@playwright/test';

const browser = await webkit.launch();
const page = await browser.newPage();
console.log(await page.evaluate(() => navigator.userAgent));
// Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15
await browser.close();

If you use the WebKit Web Inspector, then user agent will reset to some old value. Unfortunately, this is a known issue.

@warrenseine
Copy link
Author

Yes, I used the Web Inspector.

If it is indeed version 16, can you confirm that WebM is not supported? Any reason why we see these differences in feature support?

@aslushnikov
Copy link
Collaborator

aslushnikov commented Nov 1, 2022

@warrenseine the WebM should be supported on MacOS; I indeed see it doesn't play. We'll take a look.

@aslushnikov aslushnikov added v1.29 and removed triaging labels Nov 1, 2022
@aslushnikov aslushnikov changed the title [BUG] Unexpected WebKit user agent [BUG] WebKit doesn't play webm files on MacOS Nov 1, 2022
@aslushnikov aslushnikov added v1.30 and removed v1.29 labels Dec 15, 2022
@aslushnikov aslushnikov added v1.31 and removed v1.30 labels Jan 5, 2023
yury-s added a commit that referenced this issue Jan 27, 2023
@warrenseine
Copy link
Author

Cool, thanks! I'll try a nightly soon.

@warrenseine
Copy link
Author

I can confirm that playback works now, thanks! Unfortunately, I've discovered another WebM-specific issue (#20489). Please have a look!

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

Successfully merging a pull request may close this issue.

3 participants