Greetings, I’m using mopidy on a vps with ubuntu, well i want to create an app with PHP using mpd.class.php, but I’m beginner with mopidy, how can I send a command for to play a song from soundcloud using API?
Sorry for my bad english.
Greetings, I’m using mopidy on a vps with ubuntu, well i want to create an app with PHP using mpd.class.php, but I’m beginner with mopidy, how can I send a command for to play a song from soundcloud using API?
Sorry for my bad english.
Mopidy supports both mpd and a Web socket interface. Both of which are well documented so please take a look at that.
Oh I see, hmm I don’t understand this Tracklist controller: mopidy.tracklist.add
I want add a song from Soundcloud in the Queue with that command on Javascript.
I have this:
mopidy.tracklist.add({“tracks”:null,“at_position”:null,“uri”:null}).then(function(data){
console.log(data);
});
but doesn’t work
for add a video from Youtube I have this:
mopidy.tracklist.add(null,0,‘youtube:video/test.1qMPcCXYKU0’).then(function(data){
console.log(data);
});
Raw JSON using curl:
curl -X POST -H Content-Type:application/json -d '{
"method": "core.tracklist.add",
"jsonrpc": "2.0",
"params": {
"uri": "yt:https://www.youtube.com/watch?v=1qMPcCXYKU0"
},
"id": 1
}' http://localhost:6680/mopidy/rpc
or using js
mopidy.tracklist.add({"uri":"yt:https://www.youtube.com/watch?v=1qMPcCXYKU0"}).then(function(data){
console.log(data);
});
See https://github.com/dz0ny/mopidy-api-explorer for more examples.