Bug #1229
openVideoFE should save the current playlist item before it starts, then clear it after it ends that video.
30%
Description
This will allow AutoKiosk to restart where it left off.
This feature could be specific to AutoKiosk.
Related issues
Updated by Hammel 7 days ago
This should be done in dbkiosk.c:kioskGetStatus() after right before exiting the function. It should call a new function, saveState(kioskActiveVideo, position), to keep track of state of video and position.
However, kioskGetStatus() is called 4 times a second. To reduce wear on the SD card the writes should only happen once every 5 seconds. Being within 5 seconds on restart is really not something humans would care that much about - it's what happens on streaming services currently.
Given that the metadata is saved, it should be used when videofe starts. It will first have to make sure the video that was playing is still available. This means it will need to save more than just the title because there can be more than one video with the same title.
In Kiosk modes a hash should be stored to better identify the file to run. See RM #1231 for details on how scanning generates metadata in kiosk mode.
In Player modes the JSON data could be used since it has a unique identifier in the filename that is also in the JSON file. So just store the filename, which looks just like an ordinary uuid. That will identify the metadata for the video which includes the videolib.title and videolib.path, the latter relative to the videolib JSON file.
Updated by Hammel 1 day ago
- % Done changed from 10 to 20
dbkiosk.c has been updated to use a data structure for the GSlist of movies it finds. The structure includes filenames and a SHA1 hash for the file. The data amount used for the hash is just 1024x1024 so that hash is pretty weak. But it's just a test for now.
dbkiosk.c has also been updated to use the find command better by searching just for files with supported suffices.
These changes have been tested compiled. They need to be tested on an AutoKiosk system (or Kiosk, I suppose) to make sure things function just as before, without utilizing the hash for saving the data.
Updated by Hammel about 10 hours ago
- % Done changed from 20 to 30
Saving and loading status in kiosk mode is implemented and test compiled okay.
Next: in dbKioskLoad(), if kioskSavedVideo != NULL, search for the kioskSavedVideo hash match and, if found set it to the kioskActiveVideo. Whether found or not, the kioskSavedVideo entry should be cleared.
Also: when starting the video in startKiosk(), right before kioskStartStatusTimer(), call a function to set position of the just started video.
By doing this before the status timer starts the timer will pick up the new status after the video has already moved to the saved position.
For this to work, I'll need to place the saved position in the kioskActiveVideo entry and then, when it's used to set the position, it should be cleared.