收藏
回答

上传后音频无法播放

我在本地文件夹添加了一个mp3文件,然后测试的时候本地是可以播放的,编译后的文件也是没有超过2m的,但是预览和上传后都无法播放,是不是因为需要将这个文件uploadfile过啊,如果是的话这个url怎么填,填阿里云吗

回答关注问题邀请回答
收藏

6 个回答

  • 小程序/小游戏开发-Link
    小程序/小游戏开发-Link
    2018-03-29

    你好,麻烦尝试使用从根目录开始的完整路径是否可以解决问题

    2018-03-29
    有用
    回复
  • 小程序/小游戏开发-Link
    小程序/小游戏开发-Link
    2018-03-26

    请提供一个可运行的代码片段并附上操作步骤说明:https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/minicode.html

    2018-03-26
    有用
    回复
  • 小程序/小游戏开发-Link
    小程序/小游戏开发-Link
    2018-03-24

    不需要 uploadFile。麻烦提供重现问题的代码片段。

    2018-03-24
    有用
    回复
  • 2018-04-09

    是音频文件构建后完整名字中间多了串码,所以不能正常读取,我也在找这个问题怎么才能解决

    2018-04-09
    有用
    回复
  • HandZ
    HandZ
    2018-03-26

    wechatide://minicode/8XgcscmK69Yx   媒体文件上传不了,太大了

    2018-03-26
    有用
    回复
  • HandZ
    HandZ
    2018-03-26

    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>

     -->




    2018-03-26
    有用
    回复
登录 后发表内容