Skip to content

Commit

Permalink
use chrome instead
Browse files Browse the repository at this point in the history
(it's what we used to use)
  • Loading branch information
mifi committed Oct 7, 2023
1 parent a7f3535 commit 97b2ac2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist
reactive-video-tmp
packages/examples
/chromium
/browser
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Tests
on: [push, pull_request]

env:
CHROMIUM_BUILD_NUMBER: 1056772
CHROME_BUILD_NUMBER: 1056772

jobs:
test:
Expand Down Expand Up @@ -35,12 +35,12 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache chromium
id: cache-chromium
- name: Cache browser
id: cache-browser
uses: actions/cache@v3
with:
path: chromium
key: ${{ runner.os }}-chromium-${{ env.CHROMIUM_BUILD_NUMBER }}
path: browser
key: ${{ runner.os }}-browser-${{ env.CHROME_BUILD_NUMBER }}

- uses: FedericoCarboni/setup-ffmpeg@v2
with:
Expand All @@ -52,7 +52,7 @@ jobs:

- run: yarn

- run: npx @puppeteer/browsers install chromium@${{ env.CHROMIUM_BUILD_NUMBER }} chromium
- run: npx @puppeteer/browsers install chrome@${{ env.CHROME_BUILD_NUMBER }} browser/chrome

- run: yarn workspace reactive-video build
- run: npm test
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ dist
reactive-video-tmp
node_modules
examples2
/chromium
/browser
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ export default () => {
};
```

### Download chromium
### Download Chrome

You need to have installed chrome/chromium. Currently chromium buildId 1056772 is supported/tested. You can download the correct chromium build to the directory `chromium` (in the current directory):
You need to have installed Chrome/Chromium. Currently Chrome buildId 1056772 is supported/tested. You can download the correct Chrome build to the directory `browser` (in the current directory):
```bash
npx @puppeteer/browsers install chromium@1056772 chromium
npx @puppeteer/browsers install chromium@1056772 browser
```

### Shell
Expand Down Expand Up @@ -116,7 +116,7 @@ Create `index.js`:
```js
const Editor = require('@reactive-video/builder');

const browserExePath = require('@puppeteer/browsers').computeExecutablePath({ cacheDir: '.', browser: 'chromium', buildId: '1056772' }); // remember to download it first
const browserExePath = require('@puppeteer/browsers').computeExecutablePath({ cacheDir: './browser', browser: 'chrome', buildId: '1056772' }); // remember to download it first

(async () => {
const editor = Editor({
Expand Down Expand Up @@ -492,14 +492,6 @@ body {

See also https://meyerweb.com/eric/tools/css/reset/

## Running on Apple Silicon (M1/M2 arm64)

First download/unpack the ARM version of Chromium corresponding to your revision under `~/.cache/puppeteer/chrome/mac-REVISION`, then run Node/Puppeteer with:

```
PUPPETEER_EXECUTABLE_PATH=/path/to/Chromium.app/Contents/MacOS/Chromium npm test
```

### Useful commands for debugging videos

#### Compare hash of video content of two videos
Expand Down
2 changes: 1 addition & 1 deletion packages/builder/tests/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function edit(editor, opts) {
});
}

const browserExePath = computeExecutablePath({ cacheDir: '.', browser: 'chromium', buildId: '1056772' });
const browserExePath = computeExecutablePath({ cacheDir: './browser', browser: 'chrome', buildId: '1056772' });

// override logger: null to get log output
const getEditor = (opts) => Editor({ ffmpegPath: 'ffmpeg', ffprobePath: 'ffprobe', browserExePath, logger: null, ...opts });
Expand Down

0 comments on commit 97b2ac2

Please sign in to comment.