pman
pman copied to clipboard
Fix / Optimize PlayerSession Restoration
The Goal
The end-goal here is to just generally improve session persistence and restoration, both computationally and visually. Visually, the experience of restoring a previous session is fairly jarring when there's visual media involved, and starts to approach frightening if multiple tabs are also involved. This tantrum will often last for as long as 20-30sec, and then everything normalizes. I'm pretty confident that all of this weirdness can be fixed with a new algorithm for restoring a serialized session.
The Current Implementation
- (repeat for each serialized Tab)
- create empty Tab
- build a media-queue for it
- attach restored queue to the blank Tab
- find and focus the Tab's active Track
- shift focus to the active Tab
- mount 'now-playing' track for playback
- initiate loading of
TrackDatas for all restored tracks, all at once, in alphabetical order