How to show icon, title when playing online stream?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
1@berdash Offline
Junior Member
Posts: 15
Joined: Nov 2006
Reputation: 0
Post: #1
Please forgive my ignorance if this has been answered elsewhere but I have been struggling with this for a while now. I am on Dharma and writing an add-on for a radio station and the task seems simple: I have a stream url that I can play without problems using
Code:
xbmc.Player().play(url)
The problem is that the player (for example on the home page) only shows the generic loudspeaker icon and the last part of the URL as title. I want to show a .png file in the plugin directory to be shown, and a custom string instead of the URL fragment. I have tried the following:
Code:
liz = xbmcgui.ListItem('MyChannel Livestream', iconImage='icon.png', thumbnailImage='')
liz.setInfo('Audio', infoLabels={'Title': 'MyChannel Livestream', 'Genre': 'Rock'})
xbmc.Player().play(u, liz)
This runs, but neither the title is displayed nor the icon. Instead, the loudspeaker is gone and there is empty space where the icon should be. Using thumbnailImage is equally ineffective. Is there any way to alter the displayed information when playing a livestream?

And, if that is possible, can I (from an add-on script) perodically check something and change the "currently playing" info?

Cheers,
Chris
find quote
ppic Offline
Skilled Python Coder
Posts: 2,662
Joined: Feb 2009
Reputation: 10
Location: France idf
Post: #2
hi,

what's "u" in your code, for icon, you have to specify the full path / url to the image.

yes you can change a listitem by a script.

[Image: widget]
Passion-XBMC Repository Download your SVN skins and addons
TvTunes Addon Download Play your theme while browsing library
TVshow Next Aired display next aired infos from tvrage.com
Logo Downloader Script download Logo/clearart/show thumbs/poster/banner
Bande-Annonce Allociné plugin watch trailers in french and vo
SportLive Script Live score match info in XBMC (not compatible dharma)
find quote
1@berdash Offline
Junior Member
Posts: 15
Joined: Nov 2006
Reputation: 0
Post: #3
The 'u' is the string containing the full URL of the audio stream. As I said, it plays fine and the player is not the problem but what is displayed while playing.
find quote
ppic Offline
Skilled Python Coder
Posts: 2,662
Joined: Feb 2009
Reputation: 10
Location: France idf
Post: #4
here is the way i use:

Code:
video = get_video_url(url)
        playableVideoItem = xbmcgui.ListItem( video["titre"] , path = video["link"] )
        playableVideoItem.setThumbnailImage(video["image"])
        print "###%s###" % video["link"]
        xbmc.Player().play( video["link"] , playableVideoItem , False )

i think you miss to put the path in your item.

[Image: widget]
Passion-XBMC Repository Download your SVN skins and addons
TvTunes Addon Download Play your theme while browsing library
TVshow Next Aired display next aired infos from tvrage.com
Logo Downloader Script download Logo/clearart/show thumbs/poster/banner
Bande-Annonce Allociné plugin watch trailers in french and vo
SportLive Script Live score match info in XBMC (not compatible dharma)
(This post was last modified: 2010-09-13 21:05 by ppic.)
find quote
1@berdash Offline
Junior Member
Posts: 15
Joined: Nov 2006
Reputation: 0
Post: #5
Thanks folks, the icon is now sorted out by using an absolute path, determined via os.getcwd().

HOWEVER, the title or "now playing" is still at its ugly default which is the last part of the played URL. The strings in the ListItem and infoLabels are completely ignored. Any hints?
find quote
ppic Offline
Skilled Python Coder
Posts: 2,662
Joined: Feb 2009
Reputation: 10
Location: France idf
Post: #6
post your code

[Image: widget]
Passion-XBMC Repository Download your SVN skins and addons
TvTunes Addon Download Play your theme while browsing library
TVshow Next Aired display next aired infos from tvrage.com
Logo Downloader Script download Logo/clearart/show thumbs/poster/banner
Bande-Annonce Allociné plugin watch trailers in french and vo
SportLive Script Live score match info in XBMC (not compatible dharma)
find quote
1@berdash Offline
Junior Member
Posts: 15
Joined: Nov 2006
Reputation: 0
Post: #7
Almost the same code as in the first post. 'u' contains the URL to play. Playing works, icon is displayed but no title:
Code:
liz = xbmcgui.ListItem('The title I want to see', iconImage=os.getcwd()+'\icon.png', thumbnailImage=os.getcwd()+'\icon.png', path=u)
liz.setInfo('Audio', infoLabels={'Title': 'The title I want to see', 'Genre': 'Rock'})
xbmc.Player().play(u, liz)
find quote
1@berdash Offline
Junior Member
Posts: 15
Joined: Nov 2006
Reputation: 0
Post: #8
Anyone? If that code seems correct I will have to file a bug report because it is clearly not working. I'd like to be at least certain that I am at least on the right track.
find quote