问题模块 | 框架类型 | 问题类型 | API/组件名称 | 终端类型 | 微信版本 | 基础库版本 |
---|---|---|---|---|---|---|
API和组件 | 小程序 | 需求 | wx.createInnerAudioContext | 客户端 | 7.0 | 2.5.1 |
音频API 想结合列表渲染。
本来使用的是旧audio组件,src结合列表渲染很方便
这是原来的代码:
WXML:
< view wx:for = "{{wlist}}" wx:key = "id" > < view class = "wordcontainer" > < view class = "vert" > < text >< text style = "font-family:'Mongolian Baiti'; font-size:100rpx;-webkit-text-orientation: sideways-right;" >{{item.word}}</ text > \n < text style = "font-size: 35rpx;text-orientation:upright;-webkit-text-orientation: upright;" >{{item.fayin}}</ text > </ text > </ view > </ view > < view class = "wordcontainer" >{{item.ch}}</ view > < view style = "display: flex; align-items: center; justify-content: center;" > < audio name = "{{item.ch}}" src = "{{item.src}}" id = "{{item.id}}audio" author = "满语音频范例" controls></ audio > </ view > < text >\n\n</ text > </ view > |
JS data部分:
wlist:[ { id:1, word: 'ᡳ' , fayin: 'i' , ch: '的' , src: 'https://manaudio-1258616785.cos.ap-chengdu.myqcloud.com/1%E7%9A%84.mp3' }, { id:2, word: 'ᡥᠣᠵᠣ ᠨᠠ?' , fayin: 'Hojo na?' , ch: '最近怎么样?' , src: 'https://manaudio-1258616785.cos.ap-chengdu.myqcloud.com/1%E7%9A%84.mp3' } |
渲染出来的效果:
现在的问题是audio不再维护,在iOS上根本用不了。请问如何用新的API实现一样的功能呢?新人对API不是很熟悉,感觉文档写的不是很详细,api好像又是写在js里面的,如何列表渲染src参数呢?谢谢!