radio-browser.info api: count click api

This commit is contained in:
Jonas Heinrich 2020-10-18 16:47:38 +02:00
parent 3e48170588
commit 5d232586cf
2 changed files with 9 additions and 2 deletions

View File

@ -50,12 +50,19 @@ export default {
audioPlayer.fade(100, 0, 500) // FIXME persistent volume state audioPlayer.fade(100, 0, 500) // FIXME persistent volume state
audioPlayer.unload() // FIXME do unload after fadeout audioPlayer.unload() // FIXME do unload after fadeout
} }
this.$jquery.get('http://de1.api.radio-browser.info/json/url/' + station.stationuuid,
{
'User-Agent': 'Nextcloud Radio/1.0.0', // FIXME global version, doesnt seem to work
})
audioPlayer = new Howl({ audioPlayer = new Howl({
src: [station.url_resolved], src: [station.url_resolved],
volume: 0, volume: 0,
}) })
audioPlayer.play() audioPlayer.play()
audioPlayer.fade(0, 100, 500) // FIXME persistent volume state audioPlayer.fade(0, 100, 500) // FIXME persistent volume state
const stationMetadata = document.getElementById('stationMetadata')
stationMetadata.textContent = station.name
}, },
loadStations() { loadStations() {
const vm = this const vm = this
@ -65,7 +72,7 @@ export default {
order: 'clickcount', order: 'clickcount',
reverse: true, reverse: true,
offset: vm.offset, offset: vm.offset,
'User-Agent': 'Nextcloud Radio/1.0.0', // FIXME global version 'User-Agent': 'Nextcloud Radio/1.0.0', // FIXME global version, doesnt seem to work
}) })
.done(function(data) { .done(function(data) {
vm.tableData = vm.tableData.concat(data) vm.tableData = vm.tableData.concat(data)

View File

@ -3,7 +3,7 @@
<button id="playbutton" class="play" :style="playerIcon" /> <button id="playbutton" class="play" :style="playerIcon" />
<div id="volumeicon" class="full" /> <div id="volumeicon" class="full" />
<div id="volumeslider" /> <div id="volumeslider" />
<span id="station_metadata" /> <span id="stationMetadata" />
</div> </div>
</template> </template>