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

app开发详细流程图搜索优化师

app开发详细流程图,搜索优化师,中铁建设集团有限公司西北分公司,简单的网站设计图html页面&#xff1a; 视频尺寸过大会画布会撑开屏幕&#xff0c;要下滑 尺寸和视频链接是从上个页面点击传过来的&#xff0c;可自行定义 <canvas id"cvs1" type"2d" style"width: {{videoWidth}}px;height: {{videoHeight}}px;"><…

html页面:

视频尺寸过大会画布会撑开屏幕,要下滑

尺寸和视频链接是从上个页面点击传过来的,可自行定义

<canvas id="cvs1" type="2d" style="width: {{videoWidth}}px;height: {{videoHeight}}px;"></canvas>
<video id="video" src="{{tempFilePath}}" bindtimeupdate="timeUpdate"></video>
<t-button class="block" bind:tap="getCanvas" theme="primary">立即截图</t-button>
<image src="{{cropurl}}" style="width: 100%;" mode="widthFix" />

js:

 timeUpdate: function (e) {//实时播放进度 秒数var currentTime = parseInt(e.detail.currentTime)this.setData({'currentTime': currentTime,});// console.log("视频播放到第" + currentTime + "秒") //查看正在播放时间,以秒为单位},//绘制截图getCanvas() {const dpr = wx.getSystemInfoSync().pixelRatiowx.createSelectorQuery().select('#video').context(res => {console.log('select video', res)const video = this.video = res.contextvideo.pause() // 暂停视频,防止继续播放video.seek(this.data.currentTime) // 将视频定位到当前时间// console.log("视频宽度高度", this.data.videoWidth, this.data.videoHeight)wx.createSelectorQuery().selectAll('#cvs1').fields({node: true,size: true}).exec((res) => {console.log('select canvas', res)const canvas = res[0][0].nodeconst ctx1 = res[0][0].node.getContext('2d')res[0][0].node.width = this.data.videoWidthres[0][0].node.height = this.data.videoHeight//图片加载完成后绘制到画布上ctx1.drawImage(video, 0, 0, this.data.videoWidth, this.data.videoHeight);console.log("ctx1=>", ctx1)wx.canvasToTempFilePath({width: this.data.videoWidth,height: this.data.videoHeight,canvas: canvas,success: (res) => {console.log("图片路径", res.tempFilePath)
//一定要有这一步不然拿到的是空白图片this.setData({canvasurl: res.tempFilePath})//裁剪图片wx.cropImage({src: this.data.canvasurl, // 图片路径cropScale: '4:3', // 裁剪比例success: (res) => {console.log('裁剪后图片', res)this.setData({cropurl: res.tempFilePath})}})},fail: (err) => {console.log(err)}})})//   //base64//   // setTimeout(() => {//   //   this.setData({//   //     // 导出canvas的url(base64格式)//   //     canvasurl: canvas.toDataURL('image/png'),//   //     show: true//   //   })}).exec()},

http://www.hkea.cn/news/603276/

相关文章:

  • 云南做网站的公司外贸谷歌优化
  • 网页设计学徒培训可试学巢湖seo推广
  • 让顾客心动的句子seo模拟点击软件源码
  • 设计类专业包括哪些kj6699的seo综合查询
  • 手机网站制作哪家好查关键词
  • 米拓企业网站管理系统电商培训机构排名前十
  • 做效果图有哪些网站seo点击排名
  • 网络营销推广网站收录seo推广排名平台有哪些
  • 产品经理如何看待网站开发广州软件系统开发seo推广
  • wordpress 忘记管理员如何做网站seo
  • app和网站哪个有优势淘宝关键词排名
  • wordpress该域名宁波网站seo公司
  • 建购物网站怎么建呀简单的网站建设
  • 江苏省建设教育协会网站首页百度知道合伙人答题兼职入口
  • 做优化的网站平台搭建
  • 做网站需要多久网络推广是什么专业
  • 厦门加盟网站建设线上推广营销
  • 定制网站案例seo搜索引擎优化薪酬
  • 网站制作成功后怎么使用浏览器观看b站视频的最佳设置
  • 一家专门做开网店的网站北京seo专员
  • 专业企业网站搭建服务头条权重查询
  • 去哪儿网站上做民宿需要材料免费的黄冈网站有哪些平台
  • 网站建设网现在推广什么app最挣钱
  • 嘉兴装修公司做网站安装百度到桌面
  • 电商网站特点外贸营销网站建站
  • 上海市住房城乡建设管理委员会网站网络营销软文范例大全800
  • 莱芜区政协网站做网络优化的公司排名
  • 太原网站建设开发公司电商运营基本知识
  • php做企业网站seo网站推广企业
  • 万网网站备案授权书免费发布推广信息的b2b