1
0
Fork 0
radiomanifest.js/ui.js

23 lines
698 B
JavaScript
Raw Normal View History

2021-11-19 18:08:09 +01:00
// const radiomanifest = require('radiomanifest.js')
async function fai () {
2022-01-30 00:26:58 +01:00
const radio = await radiomanifest.get('https://radiomanifest.degenerazione.xyz/v0.2/examples/full-ondarossa')
2021-11-19 18:08:09 +01:00
console.log('radio?', radio)
const s = radio.getStreaming()
2021-12-26 20:00:47 +01:00
console.log(s.sources)
2021-11-19 18:08:09 +01:00
console.log(s.getOptions())
console.log(s.getSource(s.getOptions()[0]))
2021-12-26 20:00:47 +01:00
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)
})
2021-11-16 23:22:16 +01:00
}
fai()