Skip to content

Instantly share code, notes, and snippets.

@mattrobenolt
Created September 23, 2011 15:40
Show Gist options
  • Save mattrobenolt/1237693 to your computer and use it in GitHub Desktop.
Save mattrobenolt/1237693 to your computer and use it in GitHub Desktop.
import xbmc
import xbmcgui
METHODS = ("Director", "Genre", "TagLine", "Plot", "PictureURL", "Title", "OriginalTitle", "Votes", "Cast", "File", "Path", "IMDBNumber", "Year", "Premiered", "FirstAired", "Rating", "PlayCount", "LastPlayed")
class OpenGraphPlayer(xbmc.Player) :
def __init__ (self):
xbmc.Player.__init__(self)
def onPlayBackStarted(self):
if xbmc.Player().isPlayingVideo():
xbmc.log('*** CALLBACK: PLAY')
tag = xbmc.Player().getVideoInfoTag()
for method in METHODS:
try:
xbmc.log("*** get%s: %s" % (method, getattr(tag, "get"+method)()))
except:
xbmc.log("*** get%s: FAILED" % method)
xbmc.log("*** SUCCESS")
player = OpenGraphPlayer()
while 1:
xbmc.sleep(500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment