forked from boyska/radiomanifest.js
22 lines
656 B
JavaScript
22 lines
656 B
JavaScript
// const radiomanifest = require('radiomanifest.js')
|
|
async function fai () {
|
|
const radio = await radiomanifest.get('http://www.ondarossa.info/')
|
|
console.log('radio?', radio)
|
|
const s = radio.getStreaming()
|
|
console.log(s.sources)
|
|
console.log(s.getOptions())
|
|
console.log(s.getSource(s.getOptions()[0]))
|
|
console.log(s.getSource())
|
|
|
|
var audioEl = document.querySelector('#player audio')
|
|
var urls = await s.pickURLs()
|
|
console.log('audios', urls)
|
|
urls.forEach( function(url) {
|
|
var srcEl = document.createElement("source")
|
|
srcEl.setAttribute('src', url)
|
|
console.log('src', srcEl, url)
|
|
audioEl.appendChild(srcEl)
|
|
})
|
|
}
|
|
|
|
fai()
|