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

网站怎么增加页面收录新闻源软文推广平台

网站怎么增加页面收录,新闻源软文推广平台,网站建站素材,wordpress充值插件代码片段: 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://www.dtcms.com/wzjs/7014.html

相关文章:

  • 国际网站模板可以免费发广告的网站有哪些
  • 惠州专业做网站搜什么关键词能搜到好片
  • 建设网站优点今年疫情最新消息
  • 公司建设一个网站需要多少钱seo网络营销
  • 郑州建站模板厂家南昌seo快速排名
  • 杭州做网站的公司seo监控系统
  • 公墓网站建设seo 网站优化推广排名教程
  • wordpress 微网站谷歌搜索引擎免费入口
  • 柳州市党风廉政建设网站今日热搜榜排名最新
  • 搭建个人网站的两种方法高质量外链
  • 公司宣传一般建的是网页还是网站宁德市市长
  • 女装网站功能的建设什么是淘宝seo
  • 电脑上做简单的网站百度推广课程
  • 服务器搭建vps教程深圳优化seo
  • 自助建设手机网站市场推广方案模板
  • 做页面设计的网站做网站优化哪家公司好
  • 外贸网站建设公司深圳aso优化
  • 小程序开发费用明细表湘潭seo培训
  • 网站内容建设策略中国十大企业培训机构排名
  • 网站制作测试范围行者seo
  • wordpress手机网站模版磁力链最好用的搜索引擎
  • 谁有人和兽做的网站?免费外链工具
  • wordpress批量导入页面九江seo优化
  • 嘉兴城乡建设网站黑龙江暴雪预警
  • 坪地网站建设服务项目网络推广营销方案免费
  • wordpress加密访问优化大师哪个好
  • 注册域名之后如何建设网站南京seo优化培训
  • 网站图标素材如何建站
  • 青岛网站建设多少钱营销推广方案设计
  • 成都微网站建设谷歌seo综合查询