搜尋
首頁微信小程式小程式開發微信小程式使用audio元件播放音樂功能範例
微信小程式使用audio元件播放音樂功能範例May 24, 2018 am 10:57 AM
audio小程式播放

前面我們分享過很多關於微信小程式教程,本文我們主要介紹了微信小程式使用audio元件播放音樂功能,結合實例形式分析了微信小程式audio元件播放線上音樂相關操作技巧,並附帶來源碼供讀者下載參考,需要的朋友可以參考下,希望能幫助大家。

1、效果顯示

2、關鍵程式碼

① index.wxml

複製程式碼 程式碼如下:

<audio src="{{audioSrc}}" poster="{{audioPoster}}" name="{{audioName}}" author="{{audioAuthor}}" controls></audio>

② index.js

Page({
 data: {
   audioPoster: &#39;http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000&#39;,
   audioName: &#39;此时此刻&#39;,
   audioAuthor: &#39;许巍&#39;,
   audioSrc: &#39;http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46&#39;,
 }
})

大家學會了嗎?趕快動手自己嘗試一下吧。

相關推薦:

微信小程式使用者自訂模版的功能實作

實作選項卡功能的微信小程式

最完整的微信小程式專案實例

以上是微信小程式使用audio元件播放音樂功能範例的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
FiiO CP13 cassette player launches with transparent retro lookFiiO CP13 cassette player launches with transparent retro lookJun 16, 2024 am 09:52 AM

TheFiiOCP13cassetteplayerwasannouncedinJanuary.Now,FiiOisexpandingitsportfoliowithtwonewmodels-onewitharedfrontandonewithatransparentfront.Thelatternotonlyperfectlymatchestheretrocharmoftheangulardesign,butalso

小程序能用react吗小程序能用react吗Dec 29, 2022 am 11:06 AM

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

Klipsch unveils Flexus Core 300 flagship soundbar with 8K support, 12 speakers and room correctionKlipsch unveils Flexus Core 300 flagship soundbar with 8K support, 12 speakers and room correctionSep 05, 2024 am 10:16 AM

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

Soundcore Space One Pro: Anker reveals most expensive over-ear headset to dateSoundcore Space One Pro: Anker reveals most expensive over-ear headset to dateJun 26, 2024 pm 03:07 PM

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是指什么Audio是指什么Dec 25, 2023 pm 03:41 PM

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

Anker Soundcore Liberty 4 Pro: Premium earbuds with barometer, spatial audio, noise supression and interactive charging caseAnker Soundcore Liberty 4 Pro: Premium earbuds with barometer, spatial audio, noise supression and interactive charging caseAug 13, 2024 pm 03:32 PM

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

用Python编写简单的聊天程序教程用Python编写简单的聊天程序教程May 08, 2023 pm 06:37 PM

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

Doogee S punk: Rugged smartphone with powerful speakers, configurable LEDs and 10800 mAh batteryDoogee S punk: Rugged smartphone with powerful speakers, configurable LEDs and 10800 mAh batteryJun 14, 2024 am 09:12 AM

Doogeewillsoonbeofferinganewsmartphonewithauniquesellingpointintheformofalargespeakerontheback.Itisclearlynoticeableandvisuallydominatestheback.Themaximumoutputpowerisspecifiedas4watts,andaccordingtothemanufact

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

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

AI Clothes Remover

AI Clothes Remover

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

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
2 週前By尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
4 週前By尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版

EditPlus 中文破解版

EditPlus 中文破解版

體積小,語法高亮,不支援程式碼提示功能

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

Dreamweaver Mac版

Dreamweaver Mac版

視覺化網頁開發工具