我做了一个区块链的钱包.使用 vue 和SDAG jssdk
演示地址 https://the-fucking-monkeys.github.io/#/
源码在 https://github.com/the-fucking-monkeys
目前能收款能付款,但是摄像头不好使.
使用的是 vue-qrcode-reader 这款 vue 库.
涉及到调动摄像头的代码是:
<template> <div class="scan"> <h1>Scan</h1> <qrcode-stream @decode="onDecode"></qrcode-stream> </div> </template> <style scoped> </style> <script> import { QrcodeStream, QrcodeDropZone, QrcodeCapture } from "vue-qrcode-reader"; export default { components: { QrcodeStream, QrcodeDropZone, QrcodeCapture }, methods: { onDecode(decodedString) { console.log(decodedString); } } }; </script>
谁知道为什么不能访问摄像头?
![]() | 1 niubee1 2019-04-17 13:13:18 +08:00 跟钱包有什么关系? 现在币圈的能力越来越弱了 |
![]() | 2 cr4fun OP ios 的摄像头不好使,android 的可以. |
![]() | 3 natforum 2019-04-17 13:55:37 +08:00 你可以参考一下 https://github.com/consenlabs |
5 zhangjinglongi 2019-04-18 08:49:30 +08:00 这跟区块链有半毛钱关系么?。。。 |
6 good1uck 2019-04-18 19:56:20 +08:00 楼上们都说的对,和区块链没关系。顺便回答一下问题呗 /td> |
7 hurrytospring 2019-04-19 14:08:15 +08:00 排查问题要善于缩小问题,看你贴出来的这一段代码和描述,说明你完全不了解怎么去跟这个问题。 这种明显是兼容性问题,基本上 browser 调摄像头肯定是通过 webrtc 之类的去调,这个接口的兼容性怎么样。你在安卓什么版本测的,用的什么浏览器,控制台有没有报错,caniuse 有没有查过。 简单看了一下,依赖这个库 https://github.com/webrtcHacks/adapter,你直接起个简单的项目测一下这个库,确定一下具体问题。 |
![]() | 9 cr4fun OP @hurrytospring 目前扫码已经 ok 了,把 http 换成 https 就可以了。 |