前面我們分享過很多關於微信小程式教程,本文我們主要介紹了微信小程式使用audio元件播放音樂功能,結合實例形式分析了微信小程式audio元件播放線上音樂相關操作技巧,並附帶來源碼供讀者下載參考,需要的朋友可以參考下,希望能幫助大家。
1、效果顯示
2、關鍵程式碼
① index.wxml
複製程式碼 程式碼如下:
<audio src="{{audioSrc}}" poster="{{audioPoster}}" name="{{audioName}}" author="{{audioAuthor}}" controls></audio>
② index.js
Page({ data: { audioPoster: 'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000', audioName: '此时此刻', audioAuthor: '许巍', audioSrc: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46', } })
大家學會了嗎?趕快動手自己嘗試一下吧。
相關推薦:
以上是微信小程式使用audio元件播放音樂功能範例的詳細內容。更多資訊請關注PHP中文網其他相關文章!

TheFiiOCP13cassetteplayerwasannouncedinJanuary.Now,FiiOisexpandingitsportfoliowithtwonewmodels-onewitharedfrontandonewithatransparentfront.Thelatternotonlyperfectlymatchestheretrocharmoftheangulardesign,butalso

小程序能用react,其使用方法:1、基于“react-reconciler”实现一个渲染器,生成一个DSL;2、创建一个小程序组件,去解析和渲染DSL;3、安装npm,并执行开发者工具中的构建npm;4、在自己的页面中引入包,再利用api即可完成开发。

The Klipsch Flexus Core 300 is the top model in the series and is positioned above the already available Flexus Core 200 in the company's soundbar line-up. According to Klipsch, this is the first soundbar in the world whose sound can be adapted to th

Anker offers both a broad product portfolio, which not only includes various product categories, but also numerous products within each category. Audio products are no exception in this respect, with Anker offering very affordable headsets as well as

Audio是指声音的波长、频率和强度。它是一种可以被人类听觉系统感知的信号,由物体振动产生。音频通常以波形的方式存在,可以记录、存储、传输和重放。,音频是一种重要的多媒体信息,在各种领域中得到应用。随着数字技术的发展,数字音频已经成为现代音乐制作和广播领域中的主流技术。同时,音频处理和数字化也是现代音频技术的重要方向之一,它们可以改善音质、提高声音清晰度、增强声音表现力等。

Anker is developing new wireless earbuds, the Soundcore Liberty 4 Pro,which are aimed at users who are willing to dig a little deeper into their pockets for powerful features. There are currently no official details on price or availability, but unco

实现思路x01服务端的建立首先,在服务端,使用socket进行消息的接受,每接受一个socket的请求,就开启一个新的线程来管理消息的分发与接受,同时,又存在一个handler来管理所有的线程,从而实现对聊天室的各种功能的处理x02客户端的建立客户端的建立就要比服务端简单多了,客户端的作用只是对消息的发送以及接受,以及按照特定的规则去输入特定的字符从而实现不同的功能的使用,因此,在客户端这里,只需要去使用两个线程,一个是专门用于接受消息,一个是专门用于发送消息的至于为什么不用一个呢,那是因为,只

Doogeewillsoonbeofferinganewsmartphonewithauniquesellingpointintheformofalargespeakerontheback.Itisclearlynoticeableandvisuallydominatestheback.Themaximumoutputpowerisspecifiedas4watts,andaccordingtothemanufact


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

SublimeText3 Linux新版
SublimeText3 Linux最新版

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能

SublimeText3漢化版
中文版,非常好用

記事本++7.3.1
好用且免費的程式碼編輯器

Dreamweaver Mac版
視覺化網頁開發工具