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

added styling for video element and fixed issue with safari image capture #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thedude61636
Copy link

Greetings,
I've added image styling for the video element, which would let you for example set width 100% or maybe have border radius for the video element , very useful when you have full width video element
i've also fixed an issue with Ios safari, it doesn't have ImageCapture object by default, I've passed the video element to the capture method and extracted the image from there ,
I've tested this method on another project with the exact same code and it works perfectly


this.lastPicture = canvas.toDataURL(type);
});
canvas.width = video.videoWidth;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style changes are good, but this is another concern we need to address in another PR, also keep ImageCapture and if video parameter passed use it otherwise rely on ImageCapture path.

@@ -85,9 +85,9 @@ public async Task ToggleTorch()
await jSRuntime.InvokeVoidAsync("BlazorBarcodeScanner.toggleTorch");
}

public async Task<string> Capture(ElementReference canvas)
public async Task<string> Capture(ElementReference canvas, ElementReference video)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split this into another PR, too many changes here, this may need a major version change.

@thedude61636
Copy link
Author

alright, that seams reasonable
but i have a few questions what is the difference between cpp version and js version?

and would it be enough if i did this?
public async Task<string> Capture(ElementReference canvas, ElementReference? video = null)
and used image capture if video element isn't present in the js file?

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

Successfully merging this pull request may close these issues.

2 participants