File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
src/BootstrapBlazor/wwwroot/modules Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 1- import { drawImage } from "./utility.js"
2-
3- window . BootstrapBlazor = window . BootstrapBlazor || { } ;
4- window . BootstrapBlazor [ name ] = window . BootstrapBlazor [ name ] || {
5-
1+ import { drawImage , registerBootstrapBlazorModule } from "./utility.js"
62
73export async function enumerateDevices ( ) {
84 let ret = null ;
@@ -20,7 +16,7 @@ export async function enumerateDevices() {
2016export async function open ( options ) {
2117 const constrains = {
2218 video : {
23- facingMode : options . facingMode || "environment" ,
19+ facingMode : { exact : options . facingMode || "environment" } ,
2420 deviceId : options . deviceId ? { exact : options . deviceId } : null ,
2521 } ,
2622 audio : false
@@ -61,7 +57,10 @@ export async function capture(videoSelector) {
6157 const blob = await capture . takePhoto ( ) ;
6258 const image = await createImageBitmap ( blob ) ;
6359 const { offsetWidth, offsetHeight } = video ;
64- drawImage ( document . querySelector ( ".b-video-image" ) , image , offsetWidth , offsetHeight ) ;
60+ drawImage ( document . querySelector ( ".bb-video-image" ) , image , offsetWidth , offsetHeight ) ;
61+
62+ const img = document . querySelector ( ".bb-image" ) ;
63+ img . src = URL . createObjectURL ( blob ) ;
6564 }
6665 }
6766 }
You can’t perform that action at this time.
0 commit comments