Xbox Media Center - MediaInfo

[[ import xbmc import string player = xbmc.Player() print '

### Media Status:

' if player.isPlaying() == 1: { mediatime = player.getTime(); if player.isPlayingAudio() == 1: { tag = player.getMusicInfoTag() audiototal = player.getTotalTime() min = (int)(mediatime/60) seconds = (int)(mediatime%60) zerofix='' if (int)(seconds/10) == 0: zerofix='0' min2 = (int)(audiototal/60) seconds2 = (int)(audiototal%60) zerofix2='' if (int)(seconds2/10) == 0: zerofix2='0' dif=audiototal-mediatime min3 = (int)(dif/60) seconds3 = (int)(dif%60) zerofix3='' if (int)(seconds3/10) == 0: zerofix3='0' artist = tag.getArtist() title = tag.getTitle() print 'Media Type: Audio
Artist: ',artist,'
Title: ',title,'
' print 'Time: ',min,':',zerofix,seconds,' / ',min2,':',zerofix2,seconds2,'
' print 'Remaining Time: ',min3,':',zerofix3,seconds3,'
' } elif player.isPlayingVideo() == 1: { vidtag = player.getVideoInfoTag() vidtotal = player.getTotalTime() min = (int)(mediatime/60) seconds = (int)(mediatime%60) zerofix='' if (int)(seconds/10) == 0: zerofix='0' min2 = (int)(vidtotal/60) seconds2 = (int)(vidtotal%60) zerofix2='' if (int)(seconds2/10) == 0: zerofix2='0' dif=vidtotal-mediatime min3 = (int)(dif/60) seconds3 = (int)(dif%60) zerofix3='' if (int)(seconds3/10) == 0: zerofix3='0' print 'Media Type: Video
Title: ',vidtag.getTitle(),'
File Name: ',player.getPlayingFile(),'
' print 'Time: ',min,':',zerofix,seconds,' / ',min2,':',zerofix2,seconds2,'
' print 'Remaining Time: ',min3,':',zerofix3,seconds3,'
' } } else: { print 'Currently Not Playing' } ]]