2016-03-17, 12:52
I found another issue, when pressing 'next' button to playt next video in the series, the subtitle is not loaded.
But if I played the video to the end, and the player loads the next video, the subtitle is OK.
I check the log file for the difference,
- in normal situation:
video played to the end --> CDVDPlayer::CloseFile() --> player.PlayStream() --> player.setsubtitle() -->new video loaded
- when pressing 'next' :
Player didn't know the video is about to be end --> player.PlayStream() --> player.setsubtitle() --> CDVDPlayer::CloseFile() -->new video loaded
The subtitle is cleared with the closing of previous video?
--
Edit:
Not sure how to resolve this, but add an 1 second delay before player.setsubtitle() seems to be a workaround.
This helps setsubtitle() executed after CDVDPlayer::CloseFile()
But if I played the video to the end, and the player loads the next video, the subtitle is OK.
I check the log file for the difference,
- in normal situation:
video played to the end --> CDVDPlayer::CloseFile() --> player.PlayStream() --> player.setsubtitle() -->new video loaded
- when pressing 'next' :
Player didn't know the video is about to be end --> player.PlayStream() --> player.setsubtitle() --> CDVDPlayer::CloseFile() -->new video loaded
The subtitle is cleared with the closing of previous video?
--
Edit:
Not sure how to resolve this, but add an 1 second delay before player.setsubtitle() seems to be a workaround.
This helps setsubtitle() executed after CDVDPlayer::CloseFile()
Code:
diff --git a/default.py b/default.py
index 25645b5..c6f14b6 100644
--- a/default.py
+++ b/default.py
@@ -1344,7 +1344,8 @@ elif mode == 'audio' or mode == 'video' or mode == 'search' or mode == 'play' or
item.setPath(mediaURL.url)
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
-
+ if player.isPlaying():
+ xbmc.sleep(1000)
# need to seek?
if seek > 0: