2
我從我的api中獲取一些數據。如何在elm中播放音頻
{
"message":"",
"data":[
{
"title":"Test Rock Song",
"artist":"Music Artist Test",
"audioUrl":"https://xyz/radio/03+-+HS3+-+Wajah+Tum+Ho+%5BDJMaza.Info%5D.mp3",
"stateName":"California",
"cityName":"Los Angles",
"businessId":32
},
{
"title":"R&B S1",
"artist":"Music Artist Test",
"audioUrl":"https://xyz/radio/1463469171175_Ba_khuda_tumhi.mp3",
"stateName":"California",
"cityName":"Los Angles",
"businessId":32
},
{
"title":"R&B S2",
"artist":"Music Artist Test",
"audioUrl":"https://xyz/radio/1465890934054_01+-+HS3+-+Tumhe+Apna+Banane+Ka+%5BDJMaza.Info%5D.mp3",
"stateName":"California",
"cityName":"Los Angles",
"businessId":32
}
],
"count":3
}
所以我有迭代列表中的數據,每個都有一個MP3網址。我想要當我點擊鏈接然後特定的MP3將播放。
請任何人幫我實現這個功能。
感謝您的幫助。它的工作原理 –
您發佈的哪部分代碼將負責處理點擊並啓動音頻播放? –
此代碼不會啓動或停止音頻。它只是呈現一個html [''](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio)標記,其實現因瀏覽器而異。音頻組件具有用戶可以點擊來控制音頻的控件。 –