react-camera-sample's People
react-camera-sample's Issues
Videoエレメントが画面上に表示されてないと、Canvas上に動画が再生されない
- Webカメラの動画をReact-webcamで表示している。
- 内部的にはおそらく
<video>
を使っている。
- 内部的にはおそらく
- その情報をCanvasに渡して、Canvas上でもWebカメラの動画を表示できるようにしている。
- しかし、元のWebカメラ画像(
<video>
)がブラウザの画面上に存在していないとCanvas上の動画も再生されなくなる。- 特にiPadのSafariは他のブラウザより厳しい。
- つまりCanvas上でWebカメラの動画を表示するには、元のカメラ画像の表示も必要。2重に表示される。
とりあえず、元のカメラ画像の透過度100%、画面右上固定、z-indexをマイナスにして見た目上は消せるようにしたが、本質的には画面上に存在していて、無駄でスマートではない。
画像ファイル指定後、onloadを待っていない
正しくは、描画される前にonloadを待つべき
forceUpdateで強制レンダリングさせている箇所がある。
2箇所ある。なんか微妙。
- videoの再生が開始された時にCanvasを再生成する為に使用(初回ロード時にはまだvideoがなくてCanvas側でvideoを読み取れない。再生開始のタイミングなら確実にvideoを読めるなのでこのタイミングでCanvasを再生成したい)
- なにかいい対応案あれば、、、
- videoのサイズが変更された時に、Canvasのサイズも変更する為に使用( iPadを回転させた時にカメラの向きが代わり縦横比も変わるのに対処するために実装 )
- Canvasのサイズの変更のために実施しているので、Canvasのサイズをstateに持たせて更新すればいいはずだが面倒くさくてやっていない
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.