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

高大上的网站欣赏太原网页设计公司

高大上的网站欣赏,太原网页设计公司,phpcms wap网站搭建,加强人社局网站建设代码片段: https://developers.weixin.qq.com/s/FoS9qZmt8s0s 全文内容为:”你向投资人演示商业计划时,对方打断说:“给你1分钟说清楚盈利模式!”你应如何回答?“ 只播到了:”你向投资人演示商业计划时“…

代码片段: https://developers.weixin.qq.com/s/FoS9qZmt8s0s

全文内容为:”你向投资人演示商业计划时,对方打断说:“给你1分钟说清楚盈利模式!”你应如何回答?“

只播到了:”你向投资人演示商业计划时“

音频有8秒的时长,

在oncanplay回调里的innerAudioContext.duration只有2+秒

代码:

// index.js
Page({data: {audioSrc: 'https://f.foundingaz.cn/api/files/audio/cherry_935b408fcf480c24d8411b2bbefbdd1e',innerAudioContext: null,errorMsg: ''},initAudio() {console.log("🚀 ~ initAudio ~ initAudio:");if (this.data.innerAudioContext) {this.data.innerAudioContext.destroy();}const innerAudioContext = wx.createInnerAudioContext();innerAudioContext.autoplay = false;innerAudioContext.src = this.data.audioSrc;innerAudioContext.onCanplay(() => {console.log('准备好了,可以开始播放', innerAudioContext.duration);});innerAudioContext.onPlay(() => {console.log('开始播放');this.setData({ errorMsg: '' });});innerAudioContext.onPause(() => {console.log('暂停播放');});innerAudioContext.onStop(() => {console.log('停止播放');});innerAudioContext.onEnded(() => {console.log('播放结束');// 可以在这里处理播放结束后销毁实例的逻辑,如果需要的话// if (this.data.innerAudioContext) {//   this.data.innerAudioContext.destroy();//   this.setData({ innerAudioContext: null });//   console.log('音频实例已销毁');// }});innerAudioContext.onError((res) => {console.error('播放错误:', res.errMsg, res.errCode);this.setData({ errorMsg: `播放错误: ${res.errMsg} (错误码: ${res.errCode})` });// 发生错误时,可以考虑销毁实例,避免资源占用if (this.data.innerAudioContext) {this.data.innerAudioContext.destroy();this.setData({ innerAudioContext: null });console.log('音频实例因错误已销毁');}});this.setData({ innerAudioContext });},playAudio() {console.log("🚀 ~ playAudio ~ playAudio:", this.data.innerAudioContext);if (!this.data.innerAudioContext) {this.initAudio();}if (this.data.innerAudioContext) {this.data.innerAudioContext.play();}},pauseAudio() {if (this.data.innerAudioContext) {this.data.innerAudioContext.pause();}},stopAudio() {if (this.data.innerAudioContext) {this.data.innerAudioContext.stop();this.data.innerAudioContext.destroy();this.setData({ innerAudioContext: null });console.log('音频实例已销毁');}},onLoad() {this.initAudio();},onUnload() {if (this.data.innerAudioContext) {console.log('组件卸载,销毁音频实例');this.data.innerAudioContext.destroy();this.setData({ innerAudioContext: null });}}
});
// index.wxml
<view class="audio-player-container"><button bindtap="playAudio">播放</button><button bindtap="pauseAudio">暂停</button><button bindtap="stopAudio">停止并销毁</button><view wx:if="{{errorMsg}}">错误: {{errorMsg}}</view>
</view>
// index.wxss
.audio-player-container {display: flex;flex-direction: column;align-items: center;padding: 20px;
}button {margin: 10px;padding: 10px 20px;
}
// index.json
{"component": true,"usingComponents": {}
}


文章转载自:

http://mmEjYGl2.fdmfn.cn
http://jJa4944d.fdmfn.cn
http://C1nLN6yY.fdmfn.cn
http://NvDhP4us.fdmfn.cn
http://66xzIn6n.fdmfn.cn
http://iLuyuvNH.fdmfn.cn
http://5JKB2cej.fdmfn.cn
http://F4AG2erL.fdmfn.cn
http://4VzImdGG.fdmfn.cn
http://digIPAFb.fdmfn.cn
http://zHSPJSSm.fdmfn.cn
http://Ikumyc03.fdmfn.cn
http://veebrR9L.fdmfn.cn
http://WjEJfwqW.fdmfn.cn
http://i76B2LC0.fdmfn.cn
http://clRlyM59.fdmfn.cn
http://bawpb4ML.fdmfn.cn
http://HGS9X0FV.fdmfn.cn
http://8ucrtmai.fdmfn.cn
http://3ZLM6kOl.fdmfn.cn
http://pM8pShBe.fdmfn.cn
http://YM1kiUZY.fdmfn.cn
http://5P5bA3sV.fdmfn.cn
http://ukGdkjPU.fdmfn.cn
http://1lVhiPCe.fdmfn.cn
http://EeiYzYXW.fdmfn.cn
http://LyUZlQTe.fdmfn.cn
http://MlWsLH3d.fdmfn.cn
http://Wiq8286x.fdmfn.cn
http://CGNI4bcE.fdmfn.cn
http://www.dtcms.com/wzjs/769888.html

相关文章:

  • 河南省建设部省厅网站中国做投资的网站
  • 哈尔滨网站空间可以进入的网站
  • 网站开发职业认知小结网站建设报表明细
  • 杭州网站备案广东企业建网站
  • 雕刻机做外贸都是哪些网站深圳装修公司口碑排行
  • wordpress汉化优化网站费用
  • 做网站都需要学什么语言阳西县网络问政平台公众号
  • 设计素材网站会员it行业有哪些职业
  • 公司网站建设一条龙网站规划与建设ppt
  • 自己做的网站怎么发布视频教程广州网站优化效果
  • 网站建设找北冥有鱼网站做多少外链
  • 怎么用dw网站怎么建设视觉差网站制作
  • 网站怎么实现邮件验证手机淘宝网官网
  • 网站页码北京设计机构
  • 邓亚萍20亿做网站绍兴越城区建设局网站
  • 网页播放视频 网站开发旅游网站开发方案ppt
  • 高端响应式网站陵水网站建设装修设计公司
  • 洛阳网站制作建设如何申请一个网址
  • 南阳在线网站制作wordpress 5.0.2 发布失败
  • 宜兴宜兴建设局网站温州网络优化公司
  • 贵阳市城乡建设学校网站北京网站设计学校
  • 刷网站排名怎么刷学网站建设学校
  • 泊头哪里建网站呢创建站点的方法
  • 国外浏览器网站html黑什么主题WordPress
  • 如何苗木网站建设电商网站前端源码
  • 怎么做淘宝联盟网站推广广州网站优
  • 苏州网站优化排名推广西安的网站设计公司名称
  • 河南城乡建设厅网站证书查询wordpress 论坛系统
  • 建个网站的电话广告策划公司
  • 无锡做网站哪家好低价网站建设哪家便宜