-
Notifications
You must be signed in to change notification settings - Fork 329
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
fix camera upload for mobile #686
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request focuses on enhancing the Changes
Sequence DiagramsequenceDiagram
participant User
participant Component as CameraUpload
participant Browser as Browser APIs
User->>Component: Trigger openCameraUpload()
Component->>Browser: Request camera access
alt Camera Access Successful
Browser-->>Component: Return Media Stream
Component->>Component: Attach Stream to Video
Component->>User: Display Camera View
else Camera Access Failed
Browser-->>Component: Return Error
Component->>Component: Update Permission Status
Component->>User: Show Error Handling
end
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
client/components/forms/components/CameraUpload.vue (2)
8-14
: Enhance video element accessibility.Including the
muted
attribute is good for auto-playing clips (especially on iOS). For accessibility, consider adding a descriptive label so screen-reader users know there is a camera feed present.<video id="webcam" autoplay playsinline muted :class="[ { hidden: !isCapturing }, theme.fileInput.minHeight, theme.fileInput.borderRadius, 'w-full h-full object-cover' ]" + aria-label="Real-time camera feed for capturing images" webkit-playsinline />
155-206
: Refine error handling and lifecycle by resetting capture state on failure.When camera permissions are denied or an error occurs,
isCapturing
remainstrue
, potentially confusing the UI. Consider resetting it tofalse
and centralizing webcam stream startup/shutdown within the library's ownstart()
andstop()
for maintainability.} catch (err) { console.error('Camera error:', err) + this.isCapturing = false if (err.name === 'NotAllowedError' ...
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
client/components/forms/components/CameraUpload.vue
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build the Nuxt app
@JhumanJ please review this on your local
Summary by CodeRabbit
New Features
Bug Fixes