Created
October 28, 2019 21:20
-
-
Save henryjfry/0e9149b5b6714ce927bfac4972494bb8 to your computer and use it in GitHub Desktop.
/home/osmc/.kodi/addons/script.extendedinfo/resources/lib/VideoPlayer.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def play(self, url, listitem, window=False): | |
super(VideoPlayer, self).play(item=url, listitem=listitem, windowed=False, startpos=-1) | |
for i in range(30): | |
if xbmc.getCondVisibility('VideoPlayer.IsFullscreen'): | |
if window and window.window_type == 'dialog': | |
wm.add_to_stack(window) | |
window.close() | |
self.wait_for_video_end() | |
return wm.pop_stack() | |
xbmc.sleep(1000) | |
def play_from_button(self, url, listitem, window=False, type='', dbid=0): | |
Utils.show_busy() | |
if dbid != 0: | |
item = '{"%s": %s}' % (type, dbid) | |
Utils.get_kodi_json(method='Player.Open', params='{"item": %s}' % item) | |
else: | |
item = '{"file": "%s"}' % url | |
xbmc.executebuiltin('RunPlugin(%s)' % url) | |
for i in range(90): | |
xbmc.log(str(xbmcgui.getCurrentWindowDialogId())+'===>OPENINFO', level=xbmc.LOGNOTICE) | |
if xbmcgui.getCurrentWindowDialogId() > 11999 and xbmcgui.getCurrentWindowDialogId() < 12999: | |
Utils.hide_busy() | |
if xbmc.getCondVisibility('VideoPlayer.IsFullscreen'): | |
if window and window.window_type == 'dialog': | |
wm.add_to_stack(window) | |
window.close() | |
self.wait_for_video_end() | |
return wm.pop_stack() | |
xbmc.sleep(1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment