[Request] Now playing popup

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
endlesslyonline Offline
Senior Member
Posts: 180
Joined: Aug 2011
Reputation: 3
Post: #1
Here I am again, with a script request.

CAn someone please help me with a script, or as I understand, it should rather be a service, which creates a popup, for say 5 seconds, with the currently playing tv show, episode number and title.

I have 2 smartplaylist, one that plays 25 random watched sitcoms, and one that plays random unwatched. So I would love a popup coming up as soon as the next episode starts displaying the above info

find quote
pkscout Offline
Posting Freak
Posts: 1,740
Joined: Jan 2011
Reputation: 57
Location: Honolulu, HI
Post: #2
You can execute the built in command XBMC.Notification this way:

import xbmc

command = 'XBMC.Notification(%s, %s, %s, %s)' % (thetitle, thebody, timetoshow, theiconpath)

You don't have much space in the popup, but you should be able to use the title filed for the TV show name and then combine the episode number and episode title into the body. Note that timetoshow and icon are optional.

I'll have to leave to you the exercise of figuring out what show just started playing. And i know that's probably the hard part, as you have to either have XBMC trigger something when a show starts or you have to have some kind of service that constantly checks the currently playing show to see if it's different than the last time you asked.
find quote
AddonScriptorDE Offline
Skilled Python Coder
Posts: 767
Joined: May 2012
Reputation: 84
Location: Germany
Post: #3
You can also use the default info screen (Keyboard key 'i') to show this stuff (depending on the skin). I only found the WindowID for the InfoScreen with player controls (Keyboard key 'Enter'), but maybe you also find the correct ID without. I modified an existing service addon and implemented both methods (InfoScreen + Notification) for you. The dialog only appears when playing episodes.

Note: If you edit the script, you have to restart xbmc because its executed only once and keeps running in the background...

import xbmc

class PlayerEvents(xbmc.Player):
    def onPlayBackStarted(self):
        if xbmc.getInfoLabel('VideoPlayer.Episode'):
            delayInSeconds = 3
            timeToShowInSeconds = 5
            title = 'Now playing:'
            tvshowTitle = xbmc.getInfoLabel('VideoPlayer.TVShowTitle')
            episodeTitle = xbmc.getInfoLabel('VideoPlayer.Title')
            episodeNr = xbmc.getInfoLabel('VideoPlayer.Episode')
            seasonNr = xbmc.getInfoLabel('VideoPlayer.Season')
            thumb = xbmc.getInfoImage('VideoPlayer.Cover')
            body = '%s: S%sE%s - %s' % (tvshowTitle, seasonNr, episodeNr, episodeTitle)
            command = 'XBMC.Notification(%s, %s, %s, %s)' % (title, body, timeToShowInSeconds, thumb)
while (not xbmc.abortRequested):

Download full service addon as zip
(This post was last modified: 2013-07-23 20:27 by AddonScriptorDE.)
find quote
endlesslyonline Offline
Senior Member
Posts: 180
Joined: Aug 2011
Reputation: 3
Post: #4
AddonScripter, thank you very much for your time. It is appreciated
find quote