UNPKG

scandit-sdk

Version:

Scandit Barcode Scanner SDK for the Web

251 lines (250 loc) 11.5 kB
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>CameraAccess | Scandit Barcode Scanner SDK for the Web</title> <meta name="description" content="Documentation for Scandit Barcode Scanner SDK for the Web"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> <script async src="../assets/js/search.js" id="search-script"></script> </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.json" 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> </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="../modules.html">Scandit Barcode Scanner SDK for the Web</a> </li> <li> <a href="CameraAccess.html">CameraAccess</a> </li> </ul> <h1>Namespace CameraAccess</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 helper object to interact with cameras.</p> </div> </div> </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>Functions</h3> <ul class="tsd-index-list"> <li class="tsd-kind-function tsd-parent-kind-namespace"><a href="CameraAccess.html#getCameras" class="tsd-kind-icon">get<wbr>Cameras</a></li> <li class="tsd-kind-function tsd-parent-kind-namespace"><a href="CameraAccess.html#isIOSBackDualWideCameraLabel" class="tsd-kind-icon">isIOSBack<wbr>Dual<wbr>Wide<wbr>Camera<wbr>Label</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Functions</h2> <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-namespace" > <a name="getCameras" class="tsd-anchor"></a> <h3>get<wbr>Cameras</h3> <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-namespace"> <li class="tsd-signature tsd-kind-icon">get<wbr>Cameras<span class="tsd-signature-symbol">(</span>refreshDevices<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, cameraAlreadyAccessed<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/Camera.html" class="tsd-signature-type" data-tsd-kind="Interface">Camera</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Get a list of cameras (if any) available on the device, a camera access permission is requested to the user the first time this method is called if needed.</p> </div> <p>If the browser is incompatible the returned promise is rejected with a <code>UnsupportedBrowserError</code> error.</p> <p>When refreshing available devices, if updated deviceId information is detected, cameras&#39; deviceId are updated accordingly. This could happen after a camera access and stop in some situations.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>refreshDevices: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></h5> <div class="tsd-comment tsd-typography"> <p>Force a call to refresh available video devices even when information is already available.</p> </div> </li> <li> <h5>cameraAlreadyAccessed: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></h5> <div class="tsd-comment tsd-typography"> <p>Hint that a camera has already been accessed before, avoiding a possible initial camera access permission request on the first call, in cases this cannot be already reliably detected.</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="../interfaces/Camera.html" class="tsd-signature-type" data-tsd-kind="Interface">Camera</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>A promise resolving to the array of available <a href="../interfaces/Camera.html">Camera</a> objects (could be empty).</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-namespace" > <a name="isIOSBackDualWideCameraLabel" class="tsd-anchor"></a> <h3>isIOSBack<wbr>Dual<wbr>Wide<wbr>Camera<wbr>Label</h3> <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-namespace"> <li class="tsd-signature tsd-kind-icon">isIOSBack<wbr>Dual<wbr>Wide<wbr>Camera<wbr>Label<span class="tsd-signature-symbol">(</span>label<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</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"> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>label: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>The camera label.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>Whether the label identifies the camera being the iOS Back Dual camera one.</p> </li> </ul> </section> </section> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class=" "> <a href="../modules.html">Exports</a> </li> <li class=" tsd-kind-namespace"> <a href="Barcode.html">Barcode</a> </li> <li class=" tsd-kind-namespace"> <a href="BarcodePicker.html">Barcode<wbr>Picker</a> </li> <li class=" tsd-kind-namespace"> <a href="BrowserCompatibility.html">Browser<wbr>Compatibility</a> </li> <li class=" tsd-kind-namespace"> <a href="BrowserHelper.html">Browser<wbr>Helper</a> </li> <li class=" tsd-kind-namespace"> <a href="Camera.html">Camera</a> </li> <li class="current tsd-kind-namespace"> <a href="CameraAccess.html">Camera<wbr>Access</a> </li> <li class=" tsd-kind-namespace"> <a href="CameraSettings.html">Camera<wbr>Settings</a> </li> <li class=" tsd-kind-namespace"> <a href="ImageSettings.html">Image<wbr>Settings</a> </li> <li class=" tsd-kind-namespace"> <a href="Logger.html">Logger</a> </li> <li class=" tsd-kind-namespace"> <a href="Parser.html">Parser</a> </li> <li class=" tsd-kind-namespace"> <a href="RecognizedText.html">Recognized<wbr>Text</a> </li> <li class=" tsd-kind-namespace"> <a href="ScanSettings.html">Scan<wbr>Settings</a> </li> <li class=" tsd-kind-namespace"> <a href="SingleImageModeSettings.html">Single<wbr>Image<wbr>Mode<wbr>Settings</a> </li> <li class=" tsd-kind-namespace"> <a href="SymbologySettings.html">Symbology<wbr>Settings</a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> <li class=" tsd-kind-function tsd-parent-kind-namespace"> <a href="CameraAccess.html#getCameras" class="tsd-kind-icon">get<wbr>Cameras</a> </li> <li class=" tsd-kind-function tsd-parent-kind-namespace"> <a href="CameraAccess.html#isIOSBackDualWideCameraLabel" class="tsd-kind-icon">isIOSBack<wbr>Dual<wbr>Wide<wbr>Camera<wbr>Label</a> </li> </ul> </nav> </div> </div> </div> <footer class="with-border-bottom"> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li> </ul> </div> </div> </footer> <div class="container tsd-generator"> <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p> </div> <div class="overlay"></div> <script src="../assets/js/main.js"></script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-23556890-7', 'auto'); ga('send', 'pageview'); </script> </body> </html>