From 3281c41e21062405b51a84c463b2714d35661287 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Wed, 25 Mar 2020 07:50:45 +0100 Subject: [PATCH] Small workaround using OMXPlayer (#7) --- resources/lib/kodiutils.py | 5 +++++ resources/lib/modules/player.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/resources/lib/kodiutils.py b/resources/lib/kodiutils.py index 4c4d67f..83d1d58 100644 --- a/resources/lib/kodiutils.py +++ b/resources/lib/kodiutils.py @@ -381,6 +381,11 @@ def get_global_setting(key): return result.get('result', {}).get('value') +def set_global_setting(key, value): + """Set a Kodi setting""" + return jsonrpc(method='Settings.SetSettingValue', params=dict(setting=key, value=value)) + + def get_cond_visibility(condition): """Test a condition in XBMC""" return xbmc.getCondVisibility(condition) diff --git a/resources/lib/modules/player.py b/resources/lib/modules/player.py index 9fd92f8..4585bb7 100644 --- a/resources/lib/modules/player.py +++ b/resources/lib/modules/player.py @@ -35,6 +35,12 @@ class Player: """ Play the requested item. :type item: string """ + + # Workaround for Raspberry Pi 3 and older + omxplayer = kodiutils.get_global_setting('videoplayer.useomxplayer') + if omxplayer is False: + kodiutils.set_global_setting('videoplayer.useomxplayer', True) + try: # Check if we have credentials if not kodiutils.get_setting('username') or not kodiutils.get_setting('password'):