UNPKG

scandit-sdk

Version:

Scandit Barcode Scanner SDK for the Web

816 lines 186 kB
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>BarcodePicker | Scandit Barcode Scanner SDK for the Web</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">Scandit Barcode Scanner SDK for the Web</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-externals" checked /> <label class="tsd-widget" for="tsd-filter-externals">Externals</label> <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../globals.html">Globals</a> </li> <li> <a href="barcodepicker.html">BarcodePicker</a> </li> </ul> <h1>Class BarcodePicker</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-comment"> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>A barcode picker element used to get and show camera input and perform scanning operations.</p> </div> <p>The barcode picker will automatically fit and scale inside the given <em>originElement</em>.</p> <p>Each barcode picker internally contains a <a href="scanner.html">Scanner</a> object with its own WebWorker thread running a separate copy of the external Scandit Engine library. To optimize loading times and performance it&#39;s recommended to reuse the same picker and to already create the picker in advance (hidden) and just display it when needed whenever possible.</p> <p>As the loading of the external Scandit Engine library can take some time the picker always starts inactive (but showing GUI and video) and then activates, if not paused, as soon as the library is ready to scan. The <a href="barcodepicker.html#on">on</a> method targeting the <a href="barcodepicker.html#ready">ready</a> event can be used to set up a listener function to be called when the library is loaded.</p> <p>The picker can also operate in &quot;single image mode&quot;, letting the user click/tap to take a single image to be scanned via the camera (mobile/tablet) or a file select dialog (desktop). This is provided automatically as fallback by default when the OS/browser only supports part of the needed features and cannot provide direct access to the camera for video streaming and continuous scanning, or can also be forced. This behaviour can be set up on creation. Note that in this mode some of the functions provided by the picker will have no effect.</p> <p>By default an alert is shown if an internal error during scanning is encountered which prevents the scanning procedure from continuing when running on a local IP address. As this uses the built-in <a href="barcodepicker.html#scanerror">scanError</a> event functionality, if unwanted it can be disabled by calling <a href="barcodepicker.html#removealllisteners">removeAllListeners</a> on the BarcodePicker instance (right after creation).</p> <p>You are not allowed to hide the Scandit logo present in the corner of the GUI.</p> </div> </section> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="target">BarcodePicker</span> </li> </ul> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Enumerations</h3> <ul class="tsd-index-list"> <li class="tsd-kind-enum tsd-parent-kind-class tsd-is-static"><a href="../enums/barcodepicker.guistyle.html" class="tsd-kind-icon">Gui<wbr>Style</a></li> <li class="tsd-kind-enum tsd-parent-kind-class tsd-is-static"><a href="../enums/barcodepicker.objectfit.html" class="tsd-kind-icon">Object<wbr>Fit</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Events</h3> <ul class="tsd-index-list"> <li class="tsd-kind-event tsd-parent-kind-class tsd-is-static"><a href="barcodepicker.html#processframe" class="tsd-kind-icon">process<wbr>Frame</a></li> <li class="tsd-kind-event tsd-parent-kind-class tsd-is-static"><a href="barcodepicker.html#ready" class="tsd-kind-icon">ready</a></li> <li class="tsd-kind-event tsd-parent-kind-class tsd-is-static"><a href="barcodepicker.html#scan" class="tsd-kind-icon">scan</a></li> <li class="tsd-kind-event tsd-parent-kind-class tsd-is-static"><a href="barcodepicker.html#scanerror" class="tsd-kind-icon">scan<wbr>Error</a></li> <li class="tsd-kind-event tsd-parent-kind-class tsd-is-static"><a href="barcodepicker.html#submitframe" class="tsd-kind-icon">submit<wbr>Frame</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Methods</h3> <ul class="tsd-index-list"> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#accesscamera" class="tsd-kind-icon">access<wbr>Camera</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#addlistener" class="tsd-kind-icon">add<wbr>Listener</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#applycamerasettings" class="tsd-kind-icon">apply<wbr>Camera<wbr>Settings</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#applyscansettings" class="tsd-kind-icon">apply<wbr>Scan<wbr>Settings</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#clearsession" class="tsd-kind-icon">clear<wbr>Session</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#createparserforformat" class="tsd-kind-icon">create<wbr>Parser<wbr>For<wbr>Format</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#destroy" class="tsd-kind-icon">destroy</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#getactivecamera" class="tsd-kind-icon">get<wbr>Active<wbr>Camera</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#getscanner" class="tsd-kind-icon">get<wbr>Scanner</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#iscameraswitcherenabled" class="tsd-kind-icon">is<wbr>Camera<wbr>Switcher<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#ismirrorimageenabled" class="tsd-kind-icon">is<wbr>Mirror<wbr>Image<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#ispinchtozoomenabled" class="tsd-kind-icon">is<wbr>Pinch<wbr>ToZoom<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#isplaysoundonscanenabled" class="tsd-kind-icon">is<wbr>Play<wbr>Sound<wbr>OnScan<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#isready" class="tsd-kind-icon">is<wbr>Ready</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#isscanningpaused" class="tsd-kind-icon">is<wbr>Scanning<wbr>Paused</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#istaptofocusenabled" class="tsd-kind-icon">is<wbr>Tap<wbr>ToFocus<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#istorchtoggleenabled" class="tsd-kind-icon">is<wbr>Torch<wbr>Toggle<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#isvibrateonscanenabled" class="tsd-kind-icon">is<wbr>Vibrate<wbr>OnScan<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#isvisible" class="tsd-kind-icon">is<wbr>Visible</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#on" class="tsd-kind-icon">on</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#onprocessframe" class="tsd-kind-icon">on<wbr>Process<wbr>Frame</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#onready" class="tsd-kind-icon">on<wbr>Ready</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#onscan" class="tsd-kind-icon">on<wbr>Scan</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#onscanerror" class="tsd-kind-icon">on<wbr>Scan<wbr>Error</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#onsubmitframe" class="tsd-kind-icon">on<wbr>Submit<wbr>Frame</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#pausescanning" class="tsd-kind-icon">pause<wbr>Scanning</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#reassignoriginelement" class="tsd-kind-icon">reassign<wbr>Origin<wbr>Element</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#removealllisteners" class="tsd-kind-icon">remove<wbr>All<wbr>Listeners</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#removelistener" class="tsd-kind-icon">remove<wbr>Listener</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#removeprocessframelistener" class="tsd-kind-icon">remove<wbr>Process<wbr>Frame<wbr>Listener</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#removeprocessframelisteners" class="tsd-kind-icon">remove<wbr>Process<wbr>Frame<wbr>Listeners</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#removescanerrorlistener" class="tsd-kind-icon">remove<wbr>Scan<wbr>Error<wbr>Listener</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#removescanerrorlisteners" class="tsd-kind-icon">remove<wbr>Scan<wbr>Error<wbr>Listeners</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#removescanlistener" class="tsd-kind-icon">remove<wbr>Scan<wbr>Listener</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#removescanlisteners" class="tsd-kind-icon">remove<wbr>Scan<wbr>Listeners</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#removesubmitframelistener" class="tsd-kind-icon">remove<wbr>Submit<wbr>Frame<wbr>Listener</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#removesubmitframelisteners" class="tsd-kind-icon">remove<wbr>Submit<wbr>Frame<wbr>Listeners</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#resumescanning" class="tsd-kind-icon">resume<wbr>Scanning</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#setactivecamera" class="tsd-kind-icon">set<wbr>Active<wbr>Camera</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#setcameraswitcherenabled" class="tsd-kind-icon">set<wbr>Camera<wbr>Switcher<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#setguistyle" class="tsd-kind-icon">set<wbr>Gui<wbr>Style</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#setlaserarea" class="tsd-kind-icon">set<wbr>Laser<wbr>Area</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#setmirrorimageenabled" class="tsd-kind-icon">set<wbr>Mirror<wbr>Image<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#setpinchtozoomenabled" class="tsd-kind-icon">set<wbr>Pinch<wbr>ToZoom<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#setplaysoundonscanenabled" class="tsd-kind-icon">set<wbr>Play<wbr>Sound<wbr>OnScan<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#settaptofocusenabled" class="tsd-kind-icon">set<wbr>Tap<wbr>ToFocus<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#settargetscanningfps" class="tsd-kind-icon">set<wbr>Target<wbr>ScanningFPS</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#settorchenabled" class="tsd-kind-icon">set<wbr>Torch<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#settorchtoggleenabled" class="tsd-kind-icon">set<wbr>Torch<wbr>Toggle<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#setvibrateonscanenabled" class="tsd-kind-icon">set<wbr>Vibrate<wbr>OnScan<wbr>Enabled</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#setvideofit" class="tsd-kind-icon">set<wbr>Video<wbr>Fit</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#setviewfinderarea" class="tsd-kind-icon">set<wbr>Viewfinder<wbr>Area</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#setvisible" class="tsd-kind-icon">set<wbr>Visible</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="barcodepicker.html#setzoom" class="tsd-kind-icon">set<wbr>Zoom</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="barcodepicker.html#create" class="tsd-kind-icon">create</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Events</h2> <section class="tsd-panel tsd-member tsd-kind-event tsd-parent-kind-class tsd-is-static" data-tags="asmemberof "> <a name="processframe" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagStatic">Static</span> process<wbr>Frame</h3> <ul class="tsd-signatures tsd-kind-event tsd-parent-kind-class tsd-is-static"> <li class="tsd-signature tsd-kind-icon">process<wbr>Frame<span class="tsd-signature-symbol">(</span>scanResult<span class="tsd-signature-symbol">: </span><a href="scanresult.html" class="tsd-signature-type">ScanResult</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:1511</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Fired when a new frame is processed by the engine. This event is fired on every frame, independently from the number of recognized barcodes (can be none). The returned barcodes are affected by <a href="scansettings.html">ScanSettings</a>&#39;s <em>codeDuplicateFilter</em> option.</p> </div> <dl class="tsd-comment-tags"> <dt data-tag="asmemberof">asmemberof</dt> <dd data-tag="asmemberof"><p>BarcodePicker</p> </dd> </dl> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>scanResult: <a href="scanresult.html" class="tsd-signature-type">ScanResult</a></h5> <div class="tsd-comment tsd-typography"> <p>The result of the scanning operation on the image.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-event tsd-parent-kind-class tsd-is-static" data-tags="asmemberof "> <a name="ready" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagStatic">Static</span> ready</h3> <ul class="tsd-signatures tsd-kind-event tsd-parent-kind-class tsd-is-static"> <li class="tsd-signature tsd-kind-icon">ready<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:1490</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Fired when the external Scandit Engine library has been loaded and the barcode picker can thus start to scan barcodes.</p> </div> <dl class="tsd-comment-tags"> <dt data-tag="asmemberof">asmemberof</dt> <dd data-tag="asmemberof"><p>BarcodePicker</p> </dd> </dl> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-event tsd-parent-kind-class tsd-is-static" data-tags="asmemberof "> <a name="scan" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagStatic">Static</span> scan</h3> <ul class="tsd-signatures tsd-kind-event tsd-parent-kind-class tsd-is-static"> <li class="tsd-signature tsd-kind-icon">scan<span class="tsd-signature-symbol">(</span>scanResult<span class="tsd-signature-symbol">: </span><a href="scanresult.html" class="tsd-signature-type">ScanResult</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:1521</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Fired when new barcodes are recognized in the image frame. The returned barcodes are affected by <a href="scansettings.html">ScanSettings</a>&#39;s <em>codeDuplicateFilter</em> option.</p> </div> <dl class="tsd-comment-tags"> <dt data-tag="asmemberof">asmemberof</dt> <dd data-tag="asmemberof"><p>BarcodePicker</p> </dd> </dl> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>scanResult: <a href="scanresult.html" class="tsd-signature-type">ScanResult</a></h5> <div class="tsd-comment tsd-typography"> <p>The result of the scanning operation on the image.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-event tsd-parent-kind-class tsd-is-static" data-tags="asmemberof "> <a name="scanerror" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagStatic">Static</span> scan<wbr>Error</h3> <ul class="tsd-signatures tsd-kind-event tsd-parent-kind-class tsd-is-static"> <li class="tsd-signature tsd-kind-icon">scan<wbr>Error<span class="tsd-signature-symbol">(</span>error<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:1531</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Fired when an error occurs during scanning initialization and execution. The barcode picker will be automatically paused when this happens.</p> </div> <dl class="tsd-comment-tags"> <dt data-tag="asmemberof">asmemberof</dt> <dd data-tag="asmemberof"><p>BarcodePicker</p> </dd> </dl> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>error: <span class="tsd-signature-type">Error</span></h5> <div class="tsd-comment tsd-typography"> <p>The ScanditEngineError that was triggered.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-event tsd-parent-kind-class tsd-is-static" data-tags="asmemberof "> <a name="submitframe" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagStatic">Static</span> submit<wbr>Frame</h3> <ul class="tsd-signatures tsd-kind-event tsd-parent-kind-class tsd-is-static"> <li class="tsd-signature tsd-kind-icon">submit<wbr>Frame<span class="tsd-signature-symbol">(</span>scanResult<span class="tsd-signature-symbol">: </span><a href="scanresult.html" class="tsd-signature-type">ScanResult</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:1500</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Fired when a new frame is submitted to the engine to be processed. As the frame is not processed yet, the <a href="scanresult.html#barcodes">ScanResult.barcodes</a> property will always be empty (no results yet).</p> </div> <dl class="tsd-comment-tags"> <dt data-tag="asmemberof">asmemberof</dt> <dd data-tag="asmemberof"><p>BarcodePicker</p> </dd> </dl> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>scanResult: <a href="scanresult.html" class="tsd-signature-type">ScanResult</a></h5> <div class="tsd-comment tsd-typography"> <p>The result of the scanning operation on the image.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Methods</h2> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="accesscamera" class="tsd-anchor"></a> <h3>access<wbr>Camera</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">access<wbr>Camera<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="barcodepicker.html" class="tsd-signature-type">BarcodePicker</a><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:1243</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Access the currently set or default camera, requesting user permissions if needed. This method is meant to be used after the picker has been initialized with disabled camera access (<em>accessCamera</em>=false) or after <a href="barcodepicker.html#pausescanning">pauseScanning</a> has been called with the pause camera stream option. Calling this doesn&#39;t do anything if the camera is already being accessed.</p> </div> <p>Depending on device features and user permissions for camera access, any of the following errors could be the rejected result of the returned promise:</p> <ul> <li><code>PermissionDeniedError</code></li> <li><code>NotAllowedError</code></li> <li><code>NotFoundError</code></li> <li><code>AbortError</code></li> <li><code>NotReadableError</code></li> <li><code>InternalError</code></li> <li><code>NoCameraAvailableError</code></li> </ul> <p>In &quot;single image mode&quot; this method has no effect.</p> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="barcodepicker.html" class="tsd-signature-type">BarcodePicker</a><span class="tsd-signature-symbol">&gt;</span></h4> <p>A promise resolving to the updated <a href="barcodepicker.html">BarcodePicker</a> object when the camera is accessed.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="addlistener" class="tsd-anchor"></a> <h3>add<wbr>Listener</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">add<wbr>Listener<span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EventName</span>, listener<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ListenerFn</span>, once<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="barcodepicker.html" class="tsd-signature-type">BarcodePicker</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:931</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p><em>See the <a href="barcodepicker.html#on">on</a> method.</em></p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>eventName: <span class="tsd-signature-type">EventName</span></h5> <div class="tsd-comment tsd-typography"> <p>The name of the event to listen to.</p> </div> </li> <li> <h5>listener: <span class="tsd-signature-type">ListenerFn</span></h5> <div class="tsd-comment tsd-typography"> <p>The listener function.</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> once: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">true</span></h5> <div class="tsd-comment tsd-typography"> <div class="tsd-signature-symbol">Default =&nbsp;false</div> Whether the listener should just be triggered only once and then discarded. </div> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="barcodepicker.html" class="tsd-signature-type">BarcodePicker</a></h4> <p>The updated <a href="barcodepicker.html">BarcodePicker</a> object.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="applycamerasettings" class="tsd-anchor"></a> <h3>apply<wbr>Camera<wbr>Settings</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">apply<wbr>Camera<wbr>Settings<span class="tsd-signature-symbol">(</span>cameraSettings<span class="tsd-signature-symbol">?: </span><a href="../modules/camerasettings.html" class="tsd-signature-type">CameraSettings</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="barcodepicker.html" class="tsd-signature-type">BarcodePicker</a><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:548</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Try to apply new settings to the currently used camera for video input, if no settings are passed the default ones are set.</p> </div> <p>If camera access is enabled, the camera is updated and accessed with the new settings.</p> <p>Depending on device features and user permissions for camera access, any of the following errors could be the rejected result of the returned promise:</p> <ul> <li><code>PermissionDeniedError</code></li> <li><code>NotAllowedError</code></li> <li><code>NotFoundError</code></li> <li><code>AbortError</code></li> <li><code>NotReadableError</code></li> <li><code>InternalError</code></li> <li><code>NoCameraAvailableError</code></li> </ul> <p>In &quot;single image mode&quot; this method has no effect.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> cameraSettings: <a href="../modules/camerasettings.html" class="tsd-signature-type">CameraSettings</a></h5> <div class="tsd-comment tsd-typography"> <p>The new camera options used when accessing the camera, by default HD resolution is used.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="barcodepicker.html" class="tsd-signature-type">BarcodePicker</a><span class="tsd-signature-symbol">&gt;</span></h4> <p>A promise resolving to the updated <a href="barcodepicker.html">BarcodePicker</a> object when the camera is updated (and accessed, if camera access is currently enabled).</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="applyscansettings" class="tsd-anchor"></a> <h3>apply<wbr>Scan<wbr>Settings</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">apply<wbr>Scan<wbr>Settings<span class="tsd-signature-symbol">(</span>scanSettings<span class="tsd-signature-symbol">: </span><a href="scansettings.html" class="tsd-signature-type">ScanSettings</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="barcodepicker.html" class="tsd-signature-type">BarcodePicker</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:419</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Apply a new set of scan settings to the internal scanner (replacing old settings).</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>scanSettings: <a href="scansettings.html" class="tsd-signature-type">ScanSettings</a></h5> <div class="tsd-comment tsd-typography"> <p>The scan configuration object to be applied to the scanner.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="barcodepicker.html" class="tsd-signature-type">BarcodePicker</a></h4> <p>The updated <a href="barcodepicker.html">BarcodePicker</a> object.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="clearsession" class="tsd-anchor"></a> <h3>clear<wbr>Session</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">clear<wbr>Session<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="barcodepicker.html" class="tsd-signature-type">BarcodePicker</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:1322</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Clear the internal scanner session.</p> </div> <p>This removes all recognized barcodes from the scanner session and allows them to be scanned again in case a custom <em>codeDuplicateFilter</em> option was set in the <a href="scansettings.html">ScanSettings</a>.</p> </div> <h4 class="tsd-returns-title">Returns <a href="barcodepicker.html" class="tsd-signature-type">BarcodePicker</a></h4> <p>The updated <a href="barcodepicker.html">BarcodePicker</a> object.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="createparserforformat" class="tsd-anchor"></a> <h3>create<wbr>Parser<wbr>For<wbr>Format</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">create<wbr>Parser<wbr>For<wbr>Format<span class="tsd-signature-symbol">(</span>dataFormat<span class="tsd-signature-symbol">: </span><a href="../enums/parser.dataformat.html" class="tsd-signature-type">DataFormat</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="parser.html" class="tsd-signature-type">Parser</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:1258</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Create a new parser object.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>dataFormat: <a href="../enums/parser.dataformat.html" class="tsd-signature-type">DataFormat</a></h5> <div class="tsd-comment tsd-typography"> <p>The format of the input data for the parser.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="parser.html" class="tsd-signature-type">Parser</a></h4> <p>The newly created parser.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="destroy" class="tsd-anchor"></a> <h3>destroy</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">destroy<span class="tsd-signature-symbol">(</span>destroyScanner<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:402</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Stop scanning and displaying video output, remove HTML elements added to the page, destroy the internal <a href="scanner.html">Scanner</a> (by default) and destroy the barcode picker itself; ensuring complete cleanup.</p> </div> <p>This method should be called after you don&#39;t plan to use the picker anymore, before the object is automatically cleaned up by JavaScript. The barcode picker must not be used in any way after this call.</p> <p>If the <a href="scanner.html">Scanner</a> is or will be in use for other purposes, the relative option can be passed to prevent its destruction.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> destroyScanner: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> =&nbsp;true</span></h5> <div class="tsd-comment tsd-typography"> <p>Whether to destroy the internally used <a href="scanner.html">Scanner</a> or not.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="getactivecamera" class="tsd-anchor"></a> <h3>get<wbr>Active<wbr>Camera</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Active<wbr>Camera<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules/camera.html" class="tsd-signature-type">Camera</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:485</li> </ul> </aside> <div class="tsd-comment tsd-typography"> </div> <h4 class="tsd-returns-title">Returns <a href="../modules/camera.html" class="tsd-signature-type">Camera</a> <span class="tsd-signature-symbol"> | </span> <span class="tsd-signature-type">undefined</span> </h4> <p>The currently active camera.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="getscanner" class="tsd-anchor"></a> <h3>get<wbr>Scanner</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Scanner<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="scanner.html" class="tsd-signature-type">Scanner</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:1310</li> </ul> </aside> <div class="tsd-comment tsd-typography"> </div> <h4 class="tsd-returns-title">Returns <a href="scanner.html" class="tsd-signature-type">Scanner</a></h4> <p>The internally used initialized (and possibly configured) <a href="scanner.html">Scanner</a> object instance.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="iscameraswitcherenabled" class="tsd-anchor"></a> <h3>is<wbr>Camera<wbr>Switcher<wbr>Enabled</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">is<wbr>Camera<wbr>Switcher<wbr>Enabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:649</li> </ul> </aside> <div class="tsd-comment tsd-typography"> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>Whether a GUI button to switch between different cameras is shown (when available).</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="ismirrorimageenabled" class="tsd-anchor"></a> <h3>is<wbr>Mirror<wbr>Image<wbr>Enabled</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">is<wbr>Mirror<wbr>Image<wbr>Enabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:582</li> </ul> </aside> <div class="tsd-comment tsd-typography"> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>Whether the currently selected camera&#39;s video is mirrored along the vertical axis.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="ispinchtozoomenabled" class="tsd-anchor"></a> <h3>is<wbr>Pinch<wbr>ToZoom<wbr>Enabled</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">is<wbr>Pinch<wbr>ToZoom<wbr>Enabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:716</li> </ul> </aside> <div class="tsd-comment tsd-typography"> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>Whether camera zoom control via pinching gesture on the video is enabled (when available, only Chrome).</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="isplaysoundonscanenabled" class="tsd-anchor"></a> <h3>is<wbr>Play<wbr>Sound<wbr>OnScan<wbr>Enabled</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">is<wbr>Play<wbr>Sound<wbr>OnScan<wbr>Enabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:606</li> </ul> </aside> <div class="tsd-comment tsd-typography"> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>Whether a sound should be played on barcode recognition (iOS requires user input). Note that the sound is played if there&#39;s at least a barcode not rejected via <a href="scanresult.html#rejectcode">ScanResult.rejectCode</a>.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="isready" class="tsd-anchor"></a> <h3>is<wbr>Ready</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">is<wbr>Ready<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:770</li> </ul> </aside> <div class="tsd-comment tsd-typography"> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>Whether the barcode picker has loaded the external Scandit Engine library and is ready to scan.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="isscanningpaused" class="tsd-anchor"></a> <h3>is<wbr>Scanning<wbr>Paused</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">is<wbr>Scanning<wbr>Paused<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:428</li> </ul> </aside> <div class="tsd-comment tsd-typography"> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>Whether the scanning is currently paused.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="istaptofocusenabled" class="tsd-anchor"></a> <h3>is<wbr>Tap<wbr>ToFocus<wbr>Enabled</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">is<wbr>Tap<wbr>ToFocus<wbr>Enabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in lib/barcodePicker.ts:695</li> </ul> </aside> <div class="tsd-comment tsd-typography"> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>Whether manual camera focus when clicking/tapping on the video is enabled (when available, only Chrome).</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > <a name="istorchtoggleenabled" class="tsd-anchor"></a> <h3>is<wbr>Torch<wbr>Toggle<wbr>Enabled</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">is<wbr>Torch<wbr>Toggle<wbr>Enabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description">