请稍等ManixChen正在解析过程中………



javascript开启网页录制功能ES6语法 async



var body = document.body;    
body.addEventListener("click",async function(){        
    var stream = await navigator.mediaDevices.getDisplayMedia({video: true});         
    var mime = MediaRecorder.isTypeSupported("video/webm; codecs=vp9") ?"video/webm; codecs=vp9" :"video/webm";        
    var mediaRecorder = new MediaRecorder(stream, {mimeType: mime});         
    //录制        
     var chunks = [];        
      mediaRecorder.addEventListener('dataavailable', function(e) {chunks.push(e.data)})         
       //停止        
       mediaRecorder.addEventListener('stop', function(){            
           var blob = new Blob(chunks, {type: chunks[0].type});            
           var url = URL.createObjectURL(blob);            
           var a = document.createElement('a');            
           a.href = url;            
           a.download = 'video.webm';            
           a.click();       
       })       
    //手动启动       
    mediaRecorder.start()   
});

javascript

ES6

javascript 脚手架制作

javascript webpack配置

javascript webpack配置

javascript ES6重点语法记录

javascript vue3 props 验证属性

javascript webpack经常用的插件包

javascript vite构建工具入门到上手

javascript vue3 props 验证属性

javascript lodashjs常见对象的所有操作

Java中用js解析json

DIY的 ajax 框架

JS 闭包

ES6 javascript ES6 Feb 22, 2024