const inneraudioContext = wx.createInnerAudioContext(); // 创建音频播放 let backgroundContext = wx.getBackgroundAudioManager();// 创建获取音频的
|
<!-- 语音 ---> < view wx:if = "{{media.fileType =='aac'}}" class = "audioView" > < cover-view wx:if = "{{media.fileType =='aac'}}" wx:key = "this" data-indexid = "{{item_id}}" data-audiomedia = "{{note.media}}" data-mediaid = "{{media.id}}" class = "audioclass" bindtap = "audioplay" data-audio = "{{media.public_url}}" > <!--默认状态---> <!-- <cover-image class="audioImg" style="" src="{{isactive==item_id?'../../images/audioImgRun.gif':'../../images/audio.png'}}" transform="{{transform}}"></cover-image> --> < cover-image class = "audioImg" style = "{{isactive==item_id?'display:none':''}}" src = "../../images/audio.png" ></ cover-image > < cover-view wx:if = "{{isactive==item_id}}" > < cover-image wx:if = "{{index_image==0}}" class = "audioImg" style = "" src = "../../images/audio.png" ></ cover-image > < cover-image wx:if = "{{index_image==1}}" class = "audioImg" style = "" src = "{{'../../images/audio1.png'}}" ></ cover-image > < cover-image wx:if = "{{index_image==2}}" class = "audioImg" style = "" src = "../../images/audio2.png" ></ cover-image > < cover-image wx:if = "{{index_image==3}}" class = "audioImg" style = "" src = "../../images/audio.png" ></ cover-image > < cover-view class = "audioText" >{{note.voiceTime!=null? note.voiceTime:'0'}}s </ cover-view > </ cover-view > <!-- <cover-view class="audioText">{{isactive==item_id?audiotime:''}} </cover-view> --> < cover-view class = "audioText" >{{note.voiceTime!=null? note.voiceTime:'0'}}s </ cover-view > </ cover-view > |
在ios下无法播放,播放打印信息为undefine 在模拟器和安卓都可以播放出来声音
麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)