我有一个laravel应用程序,我需要在其中以html格式的文本字段输入一个二维码的值。为此,我使用了来自github的webcodecam
。我包括了演示所需的脚本和画布。但是我一直在控制台中收到此错误:
Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.
at cameraSuccess (webcodecamjs.js:17)
这是我的HTML代码。
<div class="row">
<div style="position: relative;display: inline-block;">
<canvas id="qr-canvas" width="320" height="240"></canvas>
<div class="scanner-laser laser-rightBottom" style="opacity: 0.5;"></div>
<div class="scanner-laser laser-rightTop" style="opacity: 0.5;"></div>
<div class="scanner-laser laser-leftBottom" style="opacity: 0.5;"></div>
<div class="scanner-laser laser-leftTop" style="opacity: 0.5;"></div>
</div>
</div>
这是我包含脚本的地方:
<script type="text/javascript" src="{{ asset('js/qrcodelib.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/webcodecamjs.js') }}"></script>
<script type="text/javascript">
$('#qr-canvas').WebCodeCam();
</script>