Skip to content

Conversation

@Lortet
Copy link

@Lortet Lortet commented Dec 2, 2025

This pull request disables picture-in-picture mode on the video element used by html5-qrcode.

Some browsers automatically show a picture-in-picture button on HTML video elements. This can interfere with the QR code scanning UI and lead to unintended user interactions.

To improve the user experience and avoid unwanted PiP activation, this PR explicitly disables picture-in-picture.

Changes

  • Added a call to:
    videoElement.setAttribute("disablePictureInPicture", true);
    right after the video element is created / configured.

Why this is needed

  • Prevents accidental activation of PiP mode
  • Avoids UI overlap with scanner controls
  • Ensures a consistent scanning interface across browsers

Additional notes

This change is non-breaking and only affects browsers that support the disablePictureInPicture attribute.

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.

1 participant