hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.19k stars 407 forks source link

I can't run your example with my android and ios device #209

Closed ramboLiang closed 2 years ago

ramboLiang commented 2 years ago

Hi hiukim, I have seen your documents and examples. I use Vue cli(vue version is 2.6) to run the your demonstration. I copied your example into my project and used my Android (Xiaomi pad 5) and IOS devices (iphone6s and iphone13) to access it. The access result was [failed to start], as shown in the following figure image I don't know what the problem is to make your example run successfully Hope to get your reply, thank you

ramboLiang commented 2 years ago

I didn't find any error messages on the console image

ramboLiang commented 2 years ago

Sorry, I found the cause of the problem

  1. I did not access it through localhost or 127.0.0.1, so the aframe library could not be loaded normally

  2. Because I use Vue cli, I will report an error that labels such as , are not registered during operation. I need to register them in main JS to run normally, as shown below vue2 // main.js Vue.config.ignoredElements = [ 'a-scene', 'a-asset-item', 'a-image', 'a-curvedimage', 'a-assets', 'a-text', 'a-plane', 'a-cylinder', 'a-rounded', 'a-light', 'a-entity', 'a-camera', 'a-box', 'a-sky', 'a-cursor', 'a-gltf-model', 'a-triangle', 'a-cubemap' ] vue3 // vue.config.js module.exports = { chainWebpack: config => { config.module .rule('vue') .use('vue-loader') .tap(options => { options.compilerOptions = { ...options.compilerOptions, isCustomElement: tag => tag.startsWith('a-') } return options }) } }