Fixes for review
This commit is contained in:
54
README.md
54
README.md
@@ -7,7 +7,6 @@ Powered by a [custom fork](https://github.com/RReverser/libgphoto2) of [libgphot
|
||||
# NPM
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install web-gphoto2
|
||||
// or
|
||||
@@ -15,7 +14,6 @@ yarn add web-gphoto2
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
A short example on how to use this package:
|
||||
|
||||
```ts
|
||||
@@ -43,16 +41,42 @@ async function updateConfig() {
|
||||
}
|
||||
|
||||
async function capturePreviewAsBlob() {
|
||||
// Capture a frame while in live view mode
|
||||
const blob = await camera.capturePreviewAsBlob();
|
||||
console.log("Blob:", blob);
|
||||
imageUrl = URL.createObjectURL(blob);
|
||||
// Set the imageUrl as the src of an image element in your HTML
|
||||
}
|
||||
|
||||
async function captureImageAsFile() {
|
||||
// Capture an image
|
||||
const file = await camera.captureImageAsFile();
|
||||
console.log("File:", file);
|
||||
imageUrl = URL.createObjectURL(file);
|
||||
// Set the imageUrl as the src of an image element in your HTML
|
||||
}
|
||||
```
|
||||
|
||||
# Demo
|
||||
|
||||
This repository also contains a [demo app](https://web.dev/porting-libusb-to-webusb/) running gPhoto2 on the Web:
|
||||

|
||||
|
||||
For the detailed technical write-up, see [the official blog post](https://web.dev/porting-libusb-to-webusb/). To see the demo in action, visit the hosted version [here](https://web-gphoto2.rreverser.com/) (but make sure to read the [cross-platform compatibility notes](https://web.dev/porting-libusb-to-webusb/#important-cross-platform-compatibility-notes) first).
|
||||
|
||||
If you don't have a DSLR, you can check out a recording of the demo below:
|
||||
|
||||
https://user-images.githubusercontent.com/557590/152155035-a1664656-a7d9-411f-8cb3-5f04320f1391.mp4
|
||||
|
||||
## Building
|
||||
|
||||
To build, you'll need Docker. Then:
|
||||
|
||||
```bash
|
||||
./build.sh # runs build in Docker
|
||||
npx serve examples/preact # starts a local server with COOP/COEP
|
||||
```
|
||||
|
||||
Then, navigate to http://localhost:3000/ in Chrome.
|
||||
|
||||
## Common Issues
|
||||
|
||||
### SharedArrayBuffer can not be found
|
||||
@@ -96,28 +120,6 @@ export default defineConfig({
|
||||
});
|
||||
```
|
||||
|
||||
# Demo
|
||||
|
||||
This repository also contains a [demo app](https://web.dev/porting-libusb-to-webusb/) running gPhoto2 on the Web:
|
||||

|
||||
|
||||
For the detailed technical write-up, see [the official blog post](https://web.dev/porting-libusb-to-webusb/). To see the demo in action, visit the hosted version [here](https://web-gphoto2.rreverser.com/) (but make sure to read the [cross-platform compatibility notes](https://web.dev/porting-libusb-to-webusb/#important-cross-platform-compatibility-notes) first).
|
||||
|
||||
If you don't have a DSLR, you can check out a recording of the demo below:
|
||||
|
||||
https://user-images.githubusercontent.com/557590/152155035-a1664656-a7d9-411f-8cb3-5f04320f1391.mp4
|
||||
|
||||
## Building
|
||||
|
||||
To build, you'll need Docker. Then:
|
||||
|
||||
```bash
|
||||
./build.sh # runs build in Docker
|
||||
npx serve examples/preact # starts a local server with COOP/COEP
|
||||
```
|
||||
|
||||
Then, navigate to http://localhost:3000/ in Chrome.
|
||||
|
||||
## See also
|
||||
|
||||
[RReverser/eos-remote-web](https://github.com/RReverser/eos-remote-web) - my other project for controlling Canon cameras over Web Bluetooth.
|
||||
|
||||
Reference in New Issue
Block a user