1
0
Fork 0

simple UI to test player with pickURLs

This commit is contained in:
boyska 2021-12-26 20:00:47 +01:00
parent 935fc70e99
commit e1e740dbf0
2 changed files with 16 additions and 0 deletions

View file

@ -7,5 +7,9 @@
<script src="libs/ical.min.js"></script>
<script src="dist/radiomanifest-oldstyle.bundle.js"></script>
<script src="ui.js"></script>
<div id="player">
<audio controls>
</audio>
</div>
</body>
</html>

12
ui.js
View file

@ -4,8 +4,20 @@ async function fai () {
// var radio = await get("https://boyska.degenerazione.xyz/radiomanifest/examples/empty/")
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()