Socket io api browseLibrary

Have anyone used the browseLibrary function in the socket-io api?
The syntax is browseLibrary objBrowseParameters, but it is not clear to me from the documentation what the form of objBrowseParameters should be.

I have tried this command:

socket.emit(‘browseLibrary’, {
“uri”: “radio/selection” });

This is the response, not quite what I expected.

{ navigation: { lists: [ [Object] ], prev: { uri: ‘radio’ } } }

It works fine as a Rest command, but I would prefer to use SocketIO to browse the radio selection.

Regards,

David

To me that looks fine, but it really comes down to the language you use and how the socket.io library is implemented in that language. I initially had a lot proplems with kotlin and the socket.io implementation for Android, but it was all because i did not look at the implementation of the library more carefully.

This is good tool for testing the API.

It is fine, but of course you need to explode the object inside list.
To see the content, just print data.navigation.lists

Thank for the link Joni, I will have a play. I am using node.js, though previously I used Python.

Ah ok… I did wonder that. I am a C/C++ person so json and node.js is new to me. :slight_smile:

Thank you for coming back to me. I will play further.

Regards,

David

Yep… it works!

ask browse library
Browse Library
{
availableListViews: [ ‘list’ ],
items: [
{
service: ‘webradio’,
type: ‘webradio’,
title: ‘Absolut Radio’,
artist: ‘’,
album: ‘’,
albumart: ‘https://radio-directory.firebaseapp.com/volumiobuster/src/images/radio-thumbnails/Absolut Radio.jpg’,
uri: ‘http://stream.absolutradio.de/hq/mp3-160/radioplayer/
},
{
service: ‘webradio’,
type: ‘webradio’,
title: ‘Absolut Relax’,
artist: ‘’,
album: ‘’,
albumart: ‘https://radio-directory.firebaseapp.com/volumiobuster/src/images/radio-thumbnails/Absolut Relax.jpg’,
uri: ‘http://stream.absolutradio.de/relax/mp3-160/radioplayer/
},
{
service: ‘webradio’,
type: ‘webradio’,
title: ‘ArtSound FM 92.7’,
artist: ‘’,
album: ‘’,
albumart: ‘https://radio-directory.firebaseapp.com/volumiobuster/src/images/radio-thumbnails/ArtSound FM 92.7.jpg’,
uri: ‘http://119.15.96.188/stream2.mp3
},