diff --git a/lib/player.py b/lib/player.py index 3adc53d9..478821e1 100644 --- a/lib/player.py +++ b/lib/player.py @@ -189,7 +189,8 @@ def shouldShowPostPlay(self): if self.playlist and self.playlist.TYPE == 'playlist': return False - if self.player.video.duration.asInt() <= FIVE_MINUTES_MILLIS: + if (not util.advancedSettings.postplayAlways and self.player.video.duration.asInt() <= FIVE_MINUTES_MILLIS)\ + or util.advancedSettings.postplayTimeout <= 0: return False return True diff --git a/lib/util.py b/lib/util.py index 1dfc50d8..2eefd7cf 100644 --- a/lib/util.py +++ b/lib/util.py @@ -95,6 +95,8 @@ class AdvancedSettings(object): ("auto_seek", True), ("dynamic_timeline_seek", False), ("fast_back", False), + ("postplay_always", False), + ("postplay_timeout", 16), ) def __init__(self): diff --git a/lib/windows/videoplayer.py b/lib/windows/videoplayer.py index f2f3d70b..2864aadf 100644 --- a/lib/windows/videoplayer.py +++ b/lib/windows/videoplayer.py @@ -1,6 +1,7 @@ from __future__ import absolute_import import time import threading +import math from kodi_six import xbmc from kodi_six import xbmcgui @@ -316,8 +317,8 @@ def startTimer(self): millis = (self.passoutProtection - time.time()) * 1000 util.DEBUG_LOG('Post play auto-play: Passout protection in {0}'.format(util.durationToShortText(millis))) - util.DEBUG_LOG('Staring post-play timer') - self.timeout = time.time() + 16 + util.DEBUG_LOG('Starting post-play timer') + self.timeout = time.time() + abs(util.advancedSettings.postplayTimeout) threading.Thread(target=self.countdown).start() def cancelTimer(self): @@ -341,7 +342,9 @@ def countdown(self): # self.playVideo() break elif self.timeout is not None: - self.setProperty('countdown', str(min(15, int((self.timeout or now) - now)))) + cd = min(abs(util.advancedSettings.postplayTimeout-1), int((self.timeout or now) - now)) + base = 15 / float(util.advancedSettings.postplayTimeout-1) + self.setProperty('countdown', str(int(math.ceil(base*cd)))) def getHubs(self): try: diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 90041a57..12d7916b 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -977,4 +977,12 @@ msgstr "" msgctxt "#32492" msgid "Kodi Subtitle Settings" -msgstr "" \ No newline at end of file +msgstr "" + +msgctxt "#32500" +msgid "Always show post-play screen (even for short videos)" +msgstr "" + +msgctxt "#32501" +msgid "Time-to-wait between videos on post-play" +msgstr "" diff --git a/resources/settings.xml b/resources/settings.xml index a30da7ce..07702c61 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -12,6 +12,8 @@ + +