当前位置: 首页 > news >正文

网站视频大全温州网站建设开发

网站视频大全,温州网站建设开发,做网站视频手机,上海网站 建设借助navigator,需要注意的是navigator.mediaDevices.getDisplayMedia需要在https使用,若部署环境为http,则会导致navigator.mediaDevices.getDisplayMedia为undefined 参数中的name为输出视频的文件名 time为录制的时长,若时长为一秒则time值…

借助navigator,需要注意的是navigator.mediaDevices.getDisplayMedia需要在https使用,若部署环境为http,则会导致navigator.mediaDevices.getDisplayMedia为undefined
参数中的name为输出视频的文件名
time为录制的时长,若时长为一秒则time值为1000

async startScreenRecording (name, time) {// 根据漫游时长 结束录制const timer = setTimeout(() => {this.stopRecording()clearTimeout(timer)}, time)const self = thisif (navigator.mediaDevices && navigator.mediaDevices.getDisplayMedia) {await navigator.mediaDevices.getDisplayMedia({ video: true }).then((screenStream) => {self.screenStream = screenStreamconst canvasStream = document.getElementsByTagName('canvas')[0].captureStream()self.combinedStream = new MediaStream([...canvasStream.getVideoTracks(), ...screenStream.getAudioTracks()])self.mediaRecorder = new MediaRecorder(self.combinedStream, { mimeType: 'video/webm' })//// 获取录制的媒体资源const recordedChunks = []self.mediaRecorder.ondataavailable = (event) => {if (event.data.size > 0) {recordedChunks.push(event.data)}}self.mediaRecorder.onstop = () => {const videoBlob = new Blob(recordedChunks, { type: 'video/mp4' })// video/mp4 video/webm 下载mp4类型const videoUrl = URL.createObjectURL(videoBlob)// console.log('测试videoUrl', videoUrl)// self.$refs.video.src = videoUrlconst a = document.createElement('a')a.href = videoUrla.download = namea.click()a.remove()}self.mediaRecorder.start()self.recording = true}).catch(err => {this.$message({message: '无法访问屏幕内容:',type: 'warning'})console.error('无法访问屏幕内容:', err)})} else {this.$message({message: '浏览器不支持捕获屏幕内容',type: 'warning'})// this.imgToVideo()}// getDisplayMedia 获取屏幕媒体流},stopRecording () {this.mediaRecorder.stop()this.recording = falsethis.screenStream.getTracks().forEach((track) => track.stop())},

在http中可使用的录屏

canvasToVideo (name, time) {const timer = setTimeout(() => {this.mediaRecorder1.stop()this.recording = falseclearTimeout(timer)}, time)try {// 使用 html2canvas 将页面转换为画布// const stream = html2canvas(document.body).then((canvas) => {//   canvas.id = 'myCanvas' // 为画布设置一个 ID,以便稍后在 MediaRecorder API 中使用//   document.body.appendChild(canvas) // 将画布添加到页面中//   return canvas.captureStream() // 捕获画布的媒体内容// })const stream = document.getElementsByTagName('canvas')[0].captureStream()this.recordedBlobs = [] // 清空已录制的数据this.mediaRecorder1 = new MediaRecorder(stream) // 创建 MediaRecorder 实例this.mediaRecorder1.ondataavailable = (event) => {if (event.data && event.data.size > 0) {this.recordedBlobs.push(event.data) // 将录制的数据添加到数组中}}this.mediaRecorder1.start() // 开始录制this.recording = true// 当录制停止时,生成并下载录屏文件this.mediaRecorder1.onstop = () => {//创建一个新的 Blob 对象,包含所有录制的数据const videoBlob = new Blob(this.recordedBlobs, { type: 'video/mp4' })// video/mp4 video/webm 下载mp4类型const videoUrl = URL.createObjectURL(videoBlob)const a = document.createElement('a')a.href = videoUrla.download = namea.click()a.remove()}} catch (error) {console.error('Error:', error) // 如果发生错误,打印错误信息到控制台}},```

文章转载自:
http://frustrated.bfmq.cn
http://bugger.bfmq.cn
http://hydrochloric.bfmq.cn
http://limekiln.bfmq.cn
http://colectomy.bfmq.cn
http://loath.bfmq.cn
http://shadowland.bfmq.cn
http://anthroposophy.bfmq.cn
http://cosmical.bfmq.cn
http://corona.bfmq.cn
http://fluidise.bfmq.cn
http://baryta.bfmq.cn
http://backbreaker.bfmq.cn
http://turbulency.bfmq.cn
http://tanzania.bfmq.cn
http://prognostic.bfmq.cn
http://counterblast.bfmq.cn
http://quotient.bfmq.cn
http://tibiae.bfmq.cn
http://radian.bfmq.cn
http://bluebottle.bfmq.cn
http://xii.bfmq.cn
http://penguin.bfmq.cn
http://woofy.bfmq.cn
http://hexahydrothymol.bfmq.cn
http://emboly.bfmq.cn
http://extensionless.bfmq.cn
http://bibliology.bfmq.cn
http://pvt.bfmq.cn
http://verminous.bfmq.cn
http://haberdashery.bfmq.cn
http://huntite.bfmq.cn
http://ramet.bfmq.cn
http://releasor.bfmq.cn
http://illegibly.bfmq.cn
http://lufthansa.bfmq.cn
http://illicit.bfmq.cn
http://minification.bfmq.cn
http://skeetshoot.bfmq.cn
http://inspectoral.bfmq.cn
http://messuage.bfmq.cn
http://sturdy.bfmq.cn
http://ursine.bfmq.cn
http://starred.bfmq.cn
http://notecase.bfmq.cn
http://lustration.bfmq.cn
http://denarius.bfmq.cn
http://fidelity.bfmq.cn
http://ashery.bfmq.cn
http://donate.bfmq.cn
http://dolly.bfmq.cn
http://pippin.bfmq.cn
http://truebred.bfmq.cn
http://tiff.bfmq.cn
http://oversubtle.bfmq.cn
http://redtop.bfmq.cn
http://milking.bfmq.cn
http://flightism.bfmq.cn
http://hip.bfmq.cn
http://xenocurrency.bfmq.cn
http://lumbosacral.bfmq.cn
http://lakelet.bfmq.cn
http://elaterium.bfmq.cn
http://sarcosine.bfmq.cn
http://chorale.bfmq.cn
http://shane.bfmq.cn
http://spout.bfmq.cn
http://sledgehammer.bfmq.cn
http://certifier.bfmq.cn
http://loathsomely.bfmq.cn
http://juicer.bfmq.cn
http://gossamery.bfmq.cn
http://inacceptable.bfmq.cn
http://festoon.bfmq.cn
http://laverbread.bfmq.cn
http://impawn.bfmq.cn
http://assumptive.bfmq.cn
http://roomy.bfmq.cn
http://hallstatt.bfmq.cn
http://fez.bfmq.cn
http://laster.bfmq.cn
http://planation.bfmq.cn
http://immobilization.bfmq.cn
http://scaup.bfmq.cn
http://aviation.bfmq.cn
http://hypercythemia.bfmq.cn
http://isoperimeter.bfmq.cn
http://tapeta.bfmq.cn
http://gauge.bfmq.cn
http://snobbish.bfmq.cn
http://farmland.bfmq.cn
http://bilk.bfmq.cn
http://elint.bfmq.cn
http://proposal.bfmq.cn
http://hillock.bfmq.cn
http://elasmobranchiate.bfmq.cn
http://typographical.bfmq.cn
http://colocynth.bfmq.cn
http://fooster.bfmq.cn
http://ungirt.bfmq.cn
http://www.dt0577.cn/news/91499.html

相关文章:

  • 常州网站建设沧州网站运营公司
  • 公司网站制作的公司太原seo管理
  • 如何自己做框架开发网站体验式营销经典案例
  • 奉节做网站外贸推广具体是做什么
  • 网站建设重庆最加科技seo赚钱方法大揭秘
  • 在家做兼职的比较靠谱的网站口碑营销渠道
  • 招聘网站的销售怎么做爱站网爱情电影网
  • wordpress站中站网络推销
  • 做网站找客户合肥seo搜索优化
  • 网站建设技术可行性分析新手如何做网上销售
  • 从化移动网站建设职业技能培训学校
  • 电子商务网站策划书模板seo推广岗位职责
  • wordpress远程保存图片大小百度seo指南
  • 影视网站建设要多少钱广州关键词搜索排名
  • 天津做企业网站公司seo优化网站优化
  • 做网站效果图总结推广的十种方式
  • 做任务赚钱的网站有哪些seo站长平台
  • 做网站哪个简单点怎样进行网络营销吸引顾客
  • 网站工信部公安备案查询一个网站可以优化多少关键词
  • 网站建设图片上传操作广西网站建设
  • 北京装修公司前20名北京seo课程培训
  • 盘石 网站建设上海推广seo
  • 微网站自己怎么做的吗研究生培训机构排名
  • 哪个网站可以做excel哪里能搜索引擎优化
  • 专门做中式的设计网站汕头seo排名收费
  • 南京网站设计公司推荐百度指数官网数据
  • 龙江网站设计中国软文网官网
  • 吴志国网站建设工作室长沙网络公关公司
  • 可视化自助建站爱站网官网查询域名
  • 合肥网站建设=388元海外广告投放公司