def qlickplay(self, chosen_play_addon, url, listitem, window=False): if ADDON.getSetting("window_mode") == "false": wm.add_to_stack(window) window.close() if chosen_play_addon == "UMP": xbmc.executebuiltin("RunPlugin("+url+")") elif chosen_play_addon == "iSearch" or chosen_play_addon == "Phoenix": xbmc.executebuiltin("ActivateWindow(10025,%s,return)" % url) else: super(VideoPlayer, self).play(item=url, listitem=listitem, windowed=False, startpos=-1) if ADDON.getSetting("window_mode") == "false": while not xbmc.getCondVisibility("player.hasvideo"): for i in range(60): xbmc.sleep(1000) if xbmc.getCondVisibility("player.hasvideo"): while xbmc.getCondVisibility('Window.IsActive(busydialog)'): for i in range(60): xbmc.sleep(1000) if not xbmc.getCondVisibility('Window.IsActive(busydialog)'): break break break break if xbmc.getCondVisibility("player.hasvideo"): self.wait_for_video_end() wm.pop_stack() else: wm.pop_stack()
def qlickplay(self, url, listitem, window=False, dbid=0): if dbid != 0: item = '{"movieid": %s}' % dbid else: item = '{"file":"%s"}' % url get_kodi_json(method="Player.Open", params='{"item": %s, "options":{"resume": true}}' % item) if ADDON.getSetting("window_mode") == "false": if xbmc.getCondVisibility("player.hasvideo"): if window is not False and window is not True: wm.add_to_stack(window) window.close() self.wait_for_video_end() return wm.pop_stack() else: for i in range(10): xbmc.sleep(750) while xbmc.getCondVisibility( 'Window.IsActive(progressdialog)' ) or xbmc.getCondVisibility( 'Window.IsActive(extendedprogressdialog)' ) or xbmc.getCondVisibility( 'Window.IsActive(selectdialog)' ) or xbmc.getCondVisibility( 'Window.IsActive(notification)' ) or xbmc.getCondVisibility('Window.IsActive(busydialog)'): for i in range(100): xbmc.sleep(100) if xbmc.getCondVisibility("player.hasvideo"): xbmc.sleep(500) if xbmc.getCondVisibility("player.hasvideo"): wm.add_to_stack(window) window.close() self.wait_for_video_end() return wm.pop_stack() xbmc.sleep(100) xbmc.sleep(750)
def play(self, url, listitem, window=False): if window and window.window_type == "dialog": wm.add_to_stack(window) window.close() super(VideoPlayer, self).play(item=url, listitem=listitem, windowed=False, startpos=-1) if window and window.window_type == "dialog": self.wait_for_video_end() wm.pop_stack()
def qlickplay(self, url, listitem, window=False, dbid=0): if ADDON.getSetting("window_mode") == "false": if window: wm.add_to_stack(window) window.close() if dbid != 0: if RESUME == "false": get_kodi_json( method="Player.Open", params='{"item": {"movieid": %s}, "options":{"resume": %s}}' % (dbid, "false")) else: get_kodi_json( method="Player.Open", params='{"item": {"movieid": %s}, "options":{"resume": %s}}' % (dbid, "true")) else: super(VideoPlayer, self).play(item=url, listitem=listitem, windowed=False, startpos=-1) if ADDON.getSetting("window_mode") == "false": while not xbmc.getCondVisibility("player.hasvideo"): for i in range(100): xbmc.sleep(1000) if xbmc.getCondVisibility("player.hasvideo"): while xbmc.getCondVisibility( 'Window.IsActive(busydialog)'): for i in range(50): xbmc.sleep(1000) if not xbmc.getCondVisibility( 'Window.IsActive(busydialog)'): break break break break if xbmc.getCondVisibility("player.hasvideo"): self.wait_for_video_end() wm.pop_stack() else: wm.pop_stack()
def previous_menu(self): self.close() wm.pop_stack()