diff --git a/resources/lib/youtube_plugin/kodion/player/xbmc/xbmc_playlist_player.py b/resources/lib/youtube_plugin/kodion/player/xbmc/xbmc_playlist_player.py index 120a58060..16f54ba6e 100644 --- a/resources/lib/youtube_plugin/kodion/player/xbmc/xbmc_playlist_player.py +++ b/resources/lib/youtube_plugin/kodion/player/xbmc/xbmc_playlist_player.py @@ -67,6 +67,9 @@ def stop(self): def pause(self): return self._player.pause() + def play_item(self, *args, **kwargs): + return self._player.play(*args, **kwargs) + def is_playing(self): return self._player.isPlaying() diff --git a/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py b/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py index dc0062948..6d639f6a9 100644 --- a/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py +++ b/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py @@ -67,10 +67,13 @@ def run(self, provider, context, focused=None): self.handle = context.get_handle() ui = context.get_ui() + route = ui.pop_property(REROUTE_PATH) for was_busy in (ui.pop_property(BUSY_FLAG),): if was_busy: if ui.busy_dialog_active(): ui.set_property(BUSY_FLAG) + if route: + break else: break @@ -158,7 +161,6 @@ def run(self, provider, context, focused=None): provider.run_wizard(context) try: - route = ui.pop_property(REROUTE_PATH) if route: function_cache = context.get_function_cache() result, options = function_cache.run( @@ -206,10 +208,16 @@ def run(self, provider, context, focused=None): result, show_fanart=context.get_settings().fanart_selection(), ) - result = True - xbmcplugin.setResolvedUrl(self.handle, - succeeded=result, - listitem=item) + result = xbmcplugin.addDirectoryItem(self.handle, + url=uri, + listitem=item) + if route: + playlist_player = context.get_playlist_player() + playlist_player.play_item(item=uri, listitem=item) + else: + xbmcplugin.setResolvedUrl(self.handle, + succeeded=result, + listitem=item) elif uri.startswith('script://'): uri = uri[len('script://'):]