problem with plugin listitems and default player
#1
I have a plugin with a list of music that is remotely located on remote webserver (http://).

I create the directory list and then click on an item

Code:
li = xbmcgui.ListItem( label )
li.setInfo( type = 'music', infoLabels = { 'title': label, 'genre': format, 'artist': artist } )
ok = xbmcplugin.addDirectoryItem(handle, url = stream_url, listitem = li, isFolder = False, totalItems = count)

If I leave out the setInfo, it treats it as unknown and uses the dvdplayer/mplayer to playback which plays fine but there is no useful meta data for the file playing. if I use setinfo, it defaults to PAPLAYER which cannot play the files over http so it fails.

My workaround was to set the URL to point back to my plugin, and then I manually played the file forcing the player XBMC uses by making a new instance of player with
Code:
player =  xbmc.Player(xbmc.PLAYER_CORE_MPLAYER)
and then creating a list item and meta data and sending it to the player. this works fine, but then unfortunately XBMC does not know where it is in the list or which file is playing.

Is there any way to force the default player, from a listitem/directory itself?
Also if PAPLAYER does not work with music files over http://, then surely it should decide it will be the default in this case?

any help/ideas ? many thanks.
Reply
#2
I guess what I need is a way to set the player when either creating the listitem, or as a parameter you can set with setInfo. This way, when the item is clicked, xbmc will deal with it correctly.

Is this possible? Or am I going to have to dig into xbmc source and try and add it myself? (would such a feature be accepted, it seems a useful thing for plugin creators)
Reply
#3
Alternatively it might be just better to default to DVDPLAYER/MPLAYER when the type is audio, and the protocol = http ?

Anyone around ? Smile
Reply
#4
sound interresting for a plugin i have in mind, but I can't really help you.
Reply
#5
Seems the problem was related to PAPLAYER trying to play the ogg as an mp3 as it didnt recognise the ogg mime type.

I made a patch for this..

http://trac.xbmc.org/ticket/8447

Still would be useful to be able to choose the player from the listitem itself though in cases where you want to force a player.
Reply

Logout Mark Read Team Forum Stats Members Help
problem with plugin listitems and default player0