Beispiel #1
0
def play(name, url, list_item=None):
    print 'attempting to stream file'

    if xbmc.Player().isPlayingVideo() == True:
        xbmc.Player().stop()
    if not list_item: 
        list_item = xbmcgui.ListItem(name, iconImage="DefaultVideoBig.png", thumbnailImage='', path=url)
    try:
        xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(url, list_item)
    except:
        print 'file streaming failed'
        notification("Streaming failed", "Streaming failed")
Beispiel #2
0
def download_and_play(name, url, path):
    if os.path.isfile(path) is True:
        notification('download Alert', 'The video you are trying to download already exists!')
        return False
    else:
        print 'attempting to download and play file'
        try:
            print "Starting download Thread"
            dlThread = DownloadAndPlayThread(url, path, name)
            dlThread.start()
            wait(WAITING_TIME, "Buffering")
            xbmc.Player().play(path)
        except:
            print 'download failed'