def playF4mLink(self,url,name,iconimage,proxy=None,use_proxy_for_chunks=False, maxbitrate=0, simpleDownloader=False, auth=None, streamtype='HDS',setResolved=False,swf=None):
print "URL: " + url
stopPlaying=threading.Event()
progress = xbmcgui.DialogProgress()
f4m_proxy=f4mProxy()
stopPlaying.clear()
runningthread=thread.start_new_thread(f4m_proxy.start,(stopPlaying,))
progress.create('Starting local proxy')
stream_delay = 1
progress.update( 20, "", 'Loading local proxy', "" )
xbmc.sleep(stream_delay*1000)
progress.update( 100, "", 'Loading local proxy', "" )
url_to_play=f4m_proxy.prepare_url(url,proxy,use_proxy_for_chunks,maxbitrate=maxbitrate,simpleDownloader=simpleDownloader,auth=auth, streamtype=streamtype, swf=swf)
listitem = xbmcgui.ListItem(name,path=url_to_play,thumbnailImage=iconimage)
listitem.setInfo('video', {'Title': name})
if setResolved:
return url_to_play, listitem
mplayer = MyPlayer()
mplayer.stopPlaying = stopPlaying
progress.close()
mplayer.play(url_to_play,listitem)
#xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, listitem)
firstTime=True
while True:
if stopPlaying.isSet():
break;
#if not xbmc.Player().isPlaying():
# break
xbmc.log('Sleeping...')
xbmc.sleep(200)
#if firstTime:
# xbmc.executebuiltin('Dialog.Close(all,True)')
# firstTime=False
stopPlaying.isSet()
print 'Job done'
return
评论列表
文章目录