Created
September 23, 2011 15:40
-
-
Save mattrobenolt/1237693 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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