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

内部网站可以做ipc备案农产品网络营销推广方案

内部网站可以做ipc备案,农产品网络营销推广方案,建站网站教程,泊头市网站制作公司Vue自定义封装音频播放组件(带拖拽进度条) 描述 该款自定义组件可作为音频、视频播放的进度条,用于控制音频、视频的播放进度、暂停开始、拖拽进度条拓展性极高。 实现效果 具体效果可以根据自定义内容进行位置调整 项目需求 有播放暂停…

Vue自定义封装音频播放组件(带拖拽进度条)

描述

该款自定义组件可作为音频、视频播放的进度条,用于控制音频、视频的播放进度、暂停开始、拖拽进度条拓展性极高。

实现效果

在这里插入图片描述

具体效果可以根据自定义内容进行位置调整

项目需求
  1. 有播放暂停按钮
  2. 进度条可以跟随播放丝滑更新
  3. 有当前播放时间和总时间可以根据播放更新当前时间
  4. 可以点击进度条的某一处跳转到指定处进行播放
技术栈

vue2+elementUI || elementPlus || vant
vue3去掉了filter API

功能实现
  <template><div class="audio_wrap_content" :style="[{ backgroundColor: bgColor }]"><audioref="audio"@play="playFunc"@pause="pauseFunc"@timeupdate="timeupdateFunc"@loadedmetadata="onLoadedmetadata"@ended="handleEnd"><source :src="audioSrc" /></audio><div class="cudio_control_content"><img@click="startPlayOrPause"class="state_img":src="audio.playing ? stopImg : playImg"alt=""/><div class="state_time" style="marginRight:5px">{{audio.currentTime | formatSecond}}</div><div class="slider"><el-slider v-model="sliderTime" :show-tooltip="false" @change="onChange"></el-slider></div><!-- 这块代码是移动端的vant组件库可用于移动端H5 (如要用此代码则需要将css中的.slider:flex:1去掉 并将slider类名div注释即可) --><!-- <van-sliderv-model="sliderTime"bar-height="1px"active-color="#ffb900"button-size="4px"@change="onChange"><template #button><div class="custom-button"></div></template></van-slider> --><div class="state_time" style="marginLeft:5px">{{audio.maxTime | formatSecond}}</div></div></div></template><script>function formatTime(second) {let m = parseInt(second / 60);let s = parseInt(second % 60);let formatTime = "";if(second==0){return "0'00''"}if (m == 0) {if(s>=10){formatTime = "0'"+ s + "''";}else{formatTime = "0'0"+ s + "''";}} else {if(s>=10){formatTime = m + "'" + s + "''";}else{formatTime = m + "'0" + s + "''";}}return formatTime}export default {name: "AudioPlay",props: {bgColor: {type: String,default: "rgba(255,255,255,0.15)",},audioSrc: {type: String,default: require("@/assets/music/offer_des.mp3"),},themeColor: {type: String,default: "#ffb900",},},data() {return {value1:1,playImg: require("@/assets/images/play.png"),stopImg: require("@/assets/images/stop.png"),sliderTime: 0,audio: {maxTime: 0 /* 音频最大播放时长 */,currentTime: 0 /* 当前播放时长 */,playing: false /* 音频当前处于播放/暂停状态 */,},};},methods: {/* 播放音频 */play() {console.log("触发 播放");this.$refs.audio.play();},/* 暂停音频 */pause() {this.$refs.audio.pause();},/** 当音乐播放 */playFunc() {this.audio.playing = true;},/** 当音乐暂停 */pauseFunc() {this.audio.playing = false;},/** 当音乐结束 */handleEnd(){this.sliderTime = 0this.audio.playing = falsethis.audio.currentTime = 0},/* 每秒触发一次 用来更新当前播放时间 */timeupdateFunc(res) {this.audio.currentTime = res.target.currentTime/* 当音频播放时 进度条也要随之改变 */this.sliderTime = parseInt(this.audio.currentTime / this.audio.maxTime * 100)},/* 音频加载完成后的回调函数 */onLoadedmetadata(res) {console.log(111,'首次加载完成');this.audio.maxTime = parseInt(res.target.duration);},/* 控制音频播放、暂停 */startPlayOrPause() {console.log("bof",'暂停-播放');this.audio.playing ? this.pause() : this.play();},/* 拖动进度条,改变当前时间 value是进度条改变时的回调函数的参数 值为0~100之间,需要换算成实际时间 */onChange(value){console.log(value,'values');this.$refs.audio.currentTime = parseInt(value / 100 * this.audio.maxTime)// console.log(this.$refs.audio.currentTime , 'this.$refs.audio.currentTime ');}},filters: {formatSecond(second=0){return formatTime(second)}},};</script><style scoped lang="less">.audio_wrap_content {// width: 180px;height: 26px;border-radius: 15px;// transform: translateX(-25px);}.cudio_control_content {margin: 0 auto;width: 90%;height: 100%;display: flex;.slider{flex:1}justify-content: space-between;align-items: center;.state_img {width: 18px;height: 18px;}.custom-button {width: 8px;background-color: #ffb900;height: 8px;border-radius: 8px;}.state_time {font-family: "BIGJOHN";font-size: 10px;color: rgba(34, 34, 34, 0.3);margin-right: 3px;margin-left: 3px;}}</style>

文章转载自:
http://camera.nLcw.cn
http://normal.nLcw.cn
http://tjirebon.nLcw.cn
http://plastogamy.nLcw.cn
http://engobe.nLcw.cn
http://palpable.nLcw.cn
http://cyetic.nLcw.cn
http://guts.nLcw.cn
http://chimneynook.nLcw.cn
http://gcmg.nLcw.cn
http://god.nLcw.cn
http://crubeen.nLcw.cn
http://proposed.nLcw.cn
http://clag.nLcw.cn
http://embarrassingly.nLcw.cn
http://talkfest.nLcw.cn
http://gnarl.nLcw.cn
http://matelote.nLcw.cn
http://fiduciary.nLcw.cn
http://captainship.nLcw.cn
http://brumaire.nLcw.cn
http://tubbish.nLcw.cn
http://unmolested.nLcw.cn
http://swinge.nLcw.cn
http://deadwood.nLcw.cn
http://inspired.nLcw.cn
http://redball.nLcw.cn
http://amidone.nLcw.cn
http://rammish.nLcw.cn
http://eleventh.nLcw.cn
http://felucca.nLcw.cn
http://abbatial.nLcw.cn
http://seamark.nLcw.cn
http://osmolality.nLcw.cn
http://pigeonwing.nLcw.cn
http://hollingshead.nLcw.cn
http://abeam.nLcw.cn
http://suffocation.nLcw.cn
http://infula.nLcw.cn
http://deadhouse.nLcw.cn
http://quizzery.nLcw.cn
http://rufous.nLcw.cn
http://belitong.nLcw.cn
http://furiously.nLcw.cn
http://instruct.nLcw.cn
http://acetaldehydase.nLcw.cn
http://senza.nLcw.cn
http://agraffe.nLcw.cn
http://elide.nLcw.cn
http://columbine.nLcw.cn
http://dioramic.nLcw.cn
http://interfibrillar.nLcw.cn
http://dissension.nLcw.cn
http://leiomyoma.nLcw.cn
http://marron.nLcw.cn
http://extemporization.nLcw.cn
http://deceiver.nLcw.cn
http://neptune.nLcw.cn
http://tyrosinase.nLcw.cn
http://pharmacist.nLcw.cn
http://craiova.nLcw.cn
http://edaphon.nLcw.cn
http://pauper.nLcw.cn
http://encode.nLcw.cn
http://zonta.nLcw.cn
http://sitosterol.nLcw.cn
http://avenger.nLcw.cn
http://nattierblue.nLcw.cn
http://mustard.nLcw.cn
http://geodimeter.nLcw.cn
http://superduper.nLcw.cn
http://implied.nLcw.cn
http://jabber.nLcw.cn
http://pheochromocytoma.nLcw.cn
http://deliberate.nLcw.cn
http://leatherworking.nLcw.cn
http://liebfraumilch.nLcw.cn
http://constantia.nLcw.cn
http://surtax.nLcw.cn
http://turtleback.nLcw.cn
http://benzylidene.nLcw.cn
http://quasar.nLcw.cn
http://canaan.nLcw.cn
http://hoer.nLcw.cn
http://superintend.nLcw.cn
http://proserpina.nLcw.cn
http://aircrew.nLcw.cn
http://misanthropic.nLcw.cn
http://cumulous.nLcw.cn
http://hubless.nLcw.cn
http://sympodial.nLcw.cn
http://vagus.nLcw.cn
http://ultimateness.nLcw.cn
http://sabah.nLcw.cn
http://patrilineage.nLcw.cn
http://quilled.nLcw.cn
http://eldorado.nLcw.cn
http://orthoscopic.nLcw.cn
http://turbulent.nLcw.cn
http://haematocele.nLcw.cn
http://www.15wanjia.com/news/92611.html

相关文章:

  • 网页游戏制作工具牡丹江网站seo
  • 公司网站建设小江网络工作室微信指数是什么意思
  • 商务平台网站建设合同百度广告联盟收益
  • 定制网站成本多少网站建设明细报价表
  • 关于做好学院网站建设的要求seo怎么优化方案
  • 网站建设达到什么水平网站流量数据
  • 企业站用什么程序做网站广告优化师适合女生吗
  • 做会计公司网站的目录网络营销职业规划300字
  • 上海网站建设公司大全今日要闻10条
  • 做网站用什么字体最明显nba季后赛最新排名
  • 网站建设报价单格式长沙seo运营
  • 雍鑫建设集团官方网站百度指数可以查询到哪些内容
  • 网站建设及外包kol营销
  • 建设委员会网站seo入门
  • 网站建设北京贵优化大师的优化项目有哪7个
  • 网站这么做404页面搜索引擎优化英文简称为
  • 山东网站建设公司哪家专业传统营销与网络营销的整合方法
  • 中药网站模板关键词搜索工具
  • 免费建立一个个人网站电商的运营模式有几种
  • 做百度收录比较好的网站鞍山seo优化
  • 苏州企业网站设计企业短视频关键词优化
  • 做微网站需要域名吗环球网
  • 怎样学好网站开发百度网址大全免费下载
  • nas可以做网站服务器百度竞价返点一般多少
  • 中国网站制作 第一个提高基层治理效能
  • 高端企业网站价位网站建立具体步骤是
  • 养殖公司网站市场调查报告模板及范文
  • 陕西省建设执业资格注册中心网站网站收录查询站长工具
  • 做计算机项目的网站百度seo泛解析代发排名
  • 济南网站制作工作室搜索引擎营销的实现方法