In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces WeChat Mini Programs media components audio how to use the relevant knowledge, the content is detailed and easy to understand, simple and fast operation, has a certain reference value, I believe that everyone after reading this WeChat Mini Programs media components audio how to use the article will have a harvest, let's take a look.
Audio
Audio.
The default value of the attribute name type indicates that the unique identifier of the idStringaudio component, srcString, the resource address of the audio to be played, loopBooleanfalse whether to cycle through, whether the controlsBooleantrue displays the picture resource address of the audio cover on the default control posterString default control, if the controls property value is false, the poster invalid audio name on the nameString unknown audio default control is set, if the controls attribute value is false, the author name on the name invalid authorString unknown author default control is set. If the controls attribute value is false, set the author invalid binderrorEventHandle to trigger the error event when an error occurs, detail = {errMsg: MediaError.code} bindplayEventHandle trigger the play event bindpauseEventHandle when the playback starts / resume, trigger the pause event bindtimeupdateEventHandle when the playback progress changes, detail = {currentTime, duration} bindendedEventHandle trigger the ended event when the playback reaches the end
MediaError.code
Return error code describing MEDIA_ERR_ABORTED resource acquisition prohibited by user MEDIA_ERR_NETWORD network error MEDIA_ERR_DECODE decoding error MEDIA_ERR_SRC_NOT_SUPPOERTED inappropriate resource
Sample code:
Pause setting 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')}, data: {poster:' https://cache.yisu.com/upload/information/20220117/465/14322.jpg?max_age=2592000', name: 'now', author:'Xu Wei' Src: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46',}, audioPlay: function () {this.audioCtx.play ()}, audioPause: function () {this.audioCtx.pause ()}, audio14: function () {this.audioCtx.seek (14)} AudioStart: function () {this.audioCtx.seek (0)}}) this is the end of the article on "how to use function Media component audio". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to use WeChat Mini Programs Media component audio". If you want to learn more, you are welcome to follow 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.