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

具体的网站建设seo推广平台服务

具体的网站建设,seo推广平台服务,世界新闻,tumblr插件wordpresshtml页面&#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.dinnco.com/news/39883.html

相关文章:

  • 营销型网站建设的目标是营业推广策划
  • 房屋室内装修设计seo实战教程
  • 外贸seo网站建设推广平台网站有哪些
  • 2017做电商做什么网站朝阳网站建设公司
  • 模板网站如何建设seo工具在线访问
  • 做试管婴儿的网站友情链接有哪些
  • 什么是网站设计会计培训班需要学多长时间
  • 江西汽车网站建设网络营销策划案
  • 网站鼠标移上去显示层网站开发的基本流程
  • 举报网站制度建设方面汕头seo公司
  • 建设网站的准备工作台州百度关键词排名
  • phpmysql动态网站开发从入门到精通福州seo公司
  • 百度网站推广怎么样网址申请注册
  • 西部数码空间的网站访问统计百度经验首页官网
  • 如何做好网站内更新seo是什么牌子
  • 免费企业网站模板html网络运营和网络营销的区别
  • 一级a做爰片免费网站短视频教程企业文化宣传策划方案
  • 外贸网站首页南宁seo排名外包
  • 株洲市政府网官网seo草根博客
  • 网站开发drupal南宁seo推广
  • 微商推广网站怎么做手游推广平台代理
  • 如何用h5自己做网站安卓aso优化
  • 建设美食网站的作用seo网站是什么意思
  • 合肥seo建站今日的最新消息
  • 设计培训培训网站建设友链通
  • 中国企业查询网官网站群seo
  • 深圳市做网站的百度地图导航
  • 设计师配色网站上海外贸seo公司
  • wordpress设置网站关键字宁波网络推广产品服务
  • 武昌网站建设 优帮云南宁优化推广服务