def playVideoRemote(ex_link): xbmcgui.Dialog().notification('Remote video requested', ex_link, xbmcgui.NOTIFICATION_INFO, 5000) stream_url = cda.getVideoUrls(ex_link) quality = my_addon.getSetting('quality_remote') stream_url = selectQuality(stream_url, int(quality)) if not stream_url: return False out = cda.grabInforFromLink(ex_link) if not out: out['title'] = 'Remote video' liz = xbmcgui.ListItem(out.get('title'), iconImage=out.get('img', 'DefaultVideo.png')) liz.setInfo(type="Video", infoLabels=out) try: # videoList = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) # videoList.clear() # videoList.add(stream_url) # xbmc.Player().play(videoList) xbmcPlayer = xbmc.Player() xbmcPlayer.play(stream_url, liz) #xbmcplugin.setResolvedUrl(addon_handle, True, xbmcgui.ListItem(path=stream_url)) except Exception as ex: xbmcgui.Dialog().ok('Problem z odtworzeniem.', 'Wystąpił nieznany błąd', str(ex)) return 1
def playVideoRemote(ex_link): xbmcgui.Dialog().notification('Remote video requested', ex_link , xbmcgui.NOTIFICATION_INFO, 5000) stream_url = cda.getVideoUrls(ex_link) quality = my_addon.getSetting('quality_remote') stream_url = selectQuality(stream_url,int(quality)) if not stream_url: return False out = cda.grabInforFromLink(ex_link) if not out: out['title']='Remote video' liz=xbmcgui.ListItem(out.get('title'), iconImage=out.get('img','DefaultVideo.png')) liz.setInfo( type="Video", infoLabels=out) try: # videoList = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) # videoList.clear() # videoList.add(stream_url) # xbmc.Player().play(videoList) xbmcPlayer = xbmc.Player() xbmcPlayer.play(stream_url, liz) #xbmcplugin.setResolvedUrl(addon_handle, True, xbmcgui.ListItem(path=stream_url)) except Exception as ex: xbmcgui.Dialog().ok('Problem z odtworzeniem.', 'Wystąpił nieznany błąd', str(ex)) return 1
def playVideoRemote(ex_link, wart=1): stream_url = cda.getVideoUrls(ex_link) quality = my_addon.getSetting('quality_remote') stream_url = selectQuality(stream_url, int(quality) * wart) if not stream_url: return False out = cda.grabInforFromLink(ex_link) if not out: out['title'] = 'Remote video' liz = xbmcgui.ListItem(out.get('title'), iconImage=out.get('img', 'DefaultVideo.png')) liz.setInfo(*mkinfo(type='Video', infoLabels=out)) try: Player = xbmc.Player() Player.play(stream_url, liz) except Exception as ex: xbmcgui.Dialog().ok( 'Problem z odtworzeniem.', 'Wyst\xc4\x85pi\xc5\x82 nieznany b\xc5\x82\xc4\x85d', str(ex)) return 1
decodeVideo(ex_link) elif mode[0] == 'decodeVideoManualQ': playVideoRemote(ex_link, wart=0) elif mode[0] == 'play': xbmcgui.Dialog().notification('Remote video requested', ex_link, xbmcgui.NOTIFICATION_INFO, 5000) playVideoRemote(ex_link) elif mode[0] == 'Opcje': my_addon.openSettings() xbmc.executebuiltin('XBMC.Container.Refresh()') elif mode[0] == 'UserContent': info = cda.grabInforFromLink(urllib.unquote(ex_link)) user = info.get('user', '') folders = info.get('folders', ()) if folders: addDir(u'Folder główny', ex_link=folders[0].url, mode='walk', iconImage='premium/_kategoria.png') if user: mainWalk(user, '', '') xbmcplugin.endOfDirectory(addon_handle, succeeded=True, cacheToDisc=False) else: xbmcgui.Dialog().notification(u'Folder nie jest dostępny', '', xbmcgui.NOTIFICATION_INFO, 5000)