Re: Start a player (audio player)
#1
I currently list all songs to a listview, when I click on a row, XBMC will play coresponding song.
But the first time I play a song, the audio player is not started.
So, How do I implement this scenario:
- if audio player is off, turn it on and play coresponding song.
- if audio player is on, just play selected song.
Thanks!
Reply
#2
Since you don't show how you play the song hard to tell Smile

But what you want is the standard behavior for Player.Open I guess you are playing with Playlists but need your code Smile
Reply
#3
Ah sorry I did not tell that, I am using JSON RPC to play songs Smile
Reply
#4
... Since you post in JSON part I have already guessed that Smile

But there's about 10 different ways to play a song so please show what you are using
Reply
#5
Yeah, let me describ my app in detail:
I am developing an android app, that lists all song from XBMC (via HTTP and use JSON RPC),
In the song list, If we click on every item, my App will send request to XBMC to play that song.
My issue is, i don't know what to do when i select the first song.
Reply
#6
What is the request you send ? I don't think this is a complicated question Smile
Reply
#7
I don't know exactly which method can be used to handle this.
I did think about Player.Open, but it requires a playlistid as parameter and there is no playlist exist!
Reply
#8
Well I guess my question is finally complicated :p

You said you had some code that had a certain behavior, but won't show it so hard to tell what you are doing wrong ...

Anyway Player.Open does only require a playlistid if you want to play a specific item from a playlist.
To play a song you can either Player.Open with a songid or with a file.

You can also clear the audio playlist add or insert items with either the songid or the file then Player.Open the item 0 of the audio playlist.
Reply
#9
Songid is the unique id of that song in whole library right?
I look at the documentation, Player.Open requires a playlistid, and there is no field named "Songid" >"<
Reply
#10
Or perhaps you just don't know how to read the doc and use the search function in the forum Smile

http://wiki.xbmc.org/index.php?title=JSO...layer.Open

Quote:Start playback of either the playlist with the given ID, a slideshow with the pictures from the given directory or a single file or an item from the database.

For the documentation as stated a lot in this thread and the Wiki, you should use JSONRPC.Introspect or read https://github.com/xbmc/xbmc/blob/master....json#L111 for example.
Reply
#11
Thank you much!
Smile Sorry for bothering you!
I will do a search before create a new thread from now on!
Thanks again Smile
Reply
#12
Today I found out the JSON request to do what I asked in the first post,
it is: {"jsonrpc": "2.0", "id" : 1, "method": "Player.Open", "params":[{"songid":136}]}
But when it plays to the end of the song, the Player doesn't auto jump to the next song.
Plsz tell me how to implement this?!
Thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
Re: Start a player (audio player)0