In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you how to use wx.createAudioContext in WeChat Mini Programs development to create and return audio context audioContext object, the content is easy to understand, well-organized, hope to help you solve your doubts, the following let the editor take you to study and learn "WeChat Mini Programs development how to use wx.createAudioContext to create and return audio context audioContext object" this article.
Wx.createAudioContext (audioId)
Create and return an audio context audioContext object
AudioContext
AudioContext is bound to an audio component through audioId, through which you can manipulate an audio component.
List of methods for the audioContext object:
Method parameters indicate the address of setSrcsrc audio play no playback pause no pause seekposition jump to the specified location (in s)
Sample code:
Pause sets the current playback time to 14 seconds to go back to the beginning / / audio.jsPage ({onReady: function (e) {/ / use wx.createAudioContext to get the audio context contextthis.audioCtx = wx.createAudioContext ('myAudio') this.audioCtx.setSrc (' http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46') this.audioCtx.play ()}, data: {src:''}) AudioPlay: function () {this.audioCtx.play ()}, audioPause: function () {this.audioCtx.pause ()}, audio14: function () {this.audioCtx.seek (14)}, audioStart: function () {this.audioCtx.seek (0)}}) what are the advantages of Mini Program over developers The difficulty of development is low, which can save development and operating costs, so that developers can quickly develop a Mini Program. And Mini Program can be easily obtained and spread in Wechat, which can meet the basic life applications, in line with life services offline stores and non-rigid needs of low-frequency applications. For users, it can save time cost and mobile phone memory space, and have excellent use experience at the same time.
The above is about "how to use wx.createAudioContext to create and return audio context audioContext objects in WeChat Mini Programs's development". If this article is helpful and well written, please share it with your friends to learn new knowledge. if you want to know more about it, please pay more attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.