From 9febbe88734bb0b68d7f1dfefeed1bdfcf262266 Mon Sep 17 00:00:00 2001 From: Navaron Bracke Date: Mon, 9 Sep 2024 12:34:20 +0200 Subject: [PATCH] do not show controls on video element --- lib/src/web/mobile_scanner_web.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/src/web/mobile_scanner_web.dart b/lib/src/web/mobile_scanner_web.dart index e3ada8c8d..963c13d87 100644 --- a/lib/src/web/mobile_scanner_web.dart +++ b/lib/src/web/mobile_scanner_web.dart @@ -88,6 +88,18 @@ class MobileScannerWeb extends MobileScannerPlatform { ..transformOrigin = 'center' ..pointerEvents = 'none'; + // Do not show the media controls, as this is a preview element. + // Also prevent play/pause events from changing the media controls. + videoElement.controls = false; + + videoElement.onplay = (JSAny _) { + videoElement.controls = false; + }.toJS; + + videoElement.onpause = (JSAny _) { + videoElement.controls = false; + }.toJS; + // Attach the video element to its parent container // and setup the PlatformView factory for this `textureId`. _divElement = HTMLDivElement()