コード例 #1
0
ファイル: handler.py プロジェクト: batchen/What-the-Furk
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")
コード例 #2
0
ファイル: handler.py プロジェクト: batchen/What-the-Furk
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'
コード例 #3
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_AUTO).play(url, list_item)
    except:
        print 'file streaming failed'
        notification("Streaming failed", "Streaming failed")
コード例 #4
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'