2***@qq.com
2***@qq.com
  • 发布:2018-10-16 09:44
  • 更新:2019-07-03 14:07
  • 阅读:4524

vue用到H5+的录音功能 真机模拟的时候不能实现

分类:HTML5+

vue用到H5+的录音功能 真机模拟的时候不能实现录音,报错plusready is not undefined 但是官方的demo中audio文件在真机模拟的时候是能够实现录音的。

export default {  
    data(){  
      return {  
        r: ' '  
      }  
    },  
      created(){  
        this.load()  
      },  
      methods: {  
        load(){  
          if(window.plus){  
            this.plusReady();  
          }else{  
            document.addEventListener('plusready', this.plusReady, false);  
          }  
        },  
        // 扩展API加载完毕,现在可以正常调用扩展API  
        plusReady() {  
         this. r = plus.audio.getRecorder();  
        },  
        startRecord() {  
          if (this.r == null) {  
            alert("Device not ready!");  
            return;  
          }  
          r.record({filename: "_doc/audio/"}, ()=> {  
            alert("Audio record success!");  
          }, (e)=> {  
            alert("Audio record failed: " + e.message);  
          });  
        },  
        stopRecord() {  
          this.r.stop();  
        },  
      },  
      components: {Mheader}  
    }
2018-10-16 09:44 负责人:无 分享
已邀请:
DCloud_UNI_GSQ

DCloud_UNI_GSQ

js基础需要夯实一下,this.plusReady

1***@qq.com

1***@qq.com - flowerxuegao

请问这个H5+是咋用的啊

5***@qq.com

5***@qq.com

同问,vueCli3的项目中,怎么使用H5+呢?

1***@qq.com

1***@qq.com - flowerxuegao

请问这个,h5+是收费的吗,咋使用呢?

DCloud_UNI_GSQ

DCloud_UNI_GSQ

点击顶部文档->HTML5+

1***@qq.com

1***@qq.com - flowerxuegao

好的谢谢

该问题目前已经被锁定, 无法添加新回复