小程序
小游戏
企业微信
微信支付
扫描小程序码分享
我在本地文件夹添加了一个mp3文件,然后测试的时候本地是可以播放的,编译后的文件也是没有超过2m的,但是预览和上传后都无法播放,是不是因为需要将这个文件uploadfile过啊,如果是的话这个url怎么填,填阿里云吗
6 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
你好,麻烦尝试使用从根目录开始的完整路径是否可以解决问题
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
请提供一个可运行的代码片段并附上操作步骤说明:https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/minicode.html
不需要 uploadFile。麻烦提供重现问题的代码片段。
是音频文件构建后完整名字中间多了串码,所以不能正常读取,我也在找这个问题怎么才能解决
wechatide://minicode/8XgcscmK69Yx 媒体文件上传不了,太大了
js代码:
onReady: function () {
// this.audioCtx = wx.createAudioContext('myAudio')
// this.audioCtx.setSrc('../../media/111.mp3')
// this.audioCtx.play()
},
data: {
// poster:'../../img/11.jpg',
// name:'asd',
// author:'asd'
}
// audioPause:function(){
// console.log(2);
// this.audioCtx.pause()
// },
// audioPlay:function(){
// }
wxml代码:
<!-- <view class="audio" >
<view class='yinpin' >
<audio poster="{{poster}}" name="{{name}}" author="{{author}}" src="{{src}}" id="myAudio" controls loop></audio>
</view>
<button type="primary" bindtap='audioPlay'>播放</button>
<button type="primary" bindtap="audioPause">暂停</button>
<view class='photo'>
-->
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
你好,麻烦尝试使用从根目录开始的完整路径是否可以解决问题
请提供一个可运行的代码片段并附上操作步骤说明:https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/minicode.html
不需要 uploadFile。麻烦提供重现问题的代码片段。
是音频文件构建后完整名字中间多了串码,所以不能正常读取,我也在找这个问题怎么才能解决
wechatide://minicode/8XgcscmK69Yx 媒体文件上传不了,太大了
js代码:
onReady: function () {
// this.audioCtx = wx.createAudioContext('myAudio')
// this.audioCtx.setSrc('../../media/111.mp3')
// this.audioCtx.play()
},
data: {
// poster:'../../img/11.jpg',
// name:'asd',
// author:'asd'
}
// audioPause:function(){
// console.log(2);
// this.audioCtx.pause()
// },
// audioPlay:function(){
// this.audioCtx.play()
// }
wxml代码:
<!-- <view class="audio" >
<view class='yinpin' >
<audio poster="{{poster}}" name="{{name}}" author="{{author}}" src="{{src}}" id="myAudio" controls loop></audio>
</view>
<button type="primary" bindtap='audioPlay'>播放</button>
<button type="primary" bindtap="audioPause">暂停</button>
</view>
<view class='photo'>
</view>
-->