Skip to content

perf(player): load seekbar preview pages when they are previewed - #122

Open
Priveetee wants to merge 1 commit into
InfinityLoop1308:devfrom
Priveetee:perf/seekbar-preview-on-demand
Open

Priveetee wants to merge 1 commit into
InfinityLoop1308:devfrom
Priveetee:perf/seekbar-preview-on-demand

Conversation

@Priveetee

Copy link
Copy Markdown
Contributor

Every storyboard page of a video is downloaded as soon as it opens, one after the other, starting before the first frame, and up to 48 of them stay in memory. They are only looked at when the seekbar is dragged.

A page is now downloaded when a position it covers is previewed. While the finger moves only the latest page asked is loaded next, and the 12 most recently used pages are kept.

Validation:

  • 10 minute video: 15 pages, 953 kB at every open on dev, none with this until the seekbar is dragged.
  • dragging across half of the seekbar loads the pages under the finger (8 of them, about 66 kB each) and the preview shows up as before.

Every storyboard page of a video was downloaded as soon as it opened,
one after the other, while the player was starting, and up to 48 of
them stayed in memory. They are only looked at when the seekbar is
dragged, which most playbacks never do.

A page is now downloaded when a position it covers is previewed. While
the finger moves only the latest page asked is loaded next, and the
twelve most recently used pages are kept.
@InfinityLoop1308

Copy link
Copy Markdown
Owner

I need some time to think about this. An issue is that if we don't do preload new drags will not have previews.

@Priveetee

Copy link
Copy Markdown
Contributor Author

Sure, take ur time :)

U're right, the first time u drag somewhere the preview comes a bit late. I did it because right now every video downloads all its previews when it opens (almost 1 MB for a 10 min video), even if u never touch the seekbar.

Maybe a middle ground: nothing when the video opens, and load them all the first time the seekbar is touched? I haven't tried it tho.

If u have any question just ask (˶ᵔ ᵕ ᵔ˶)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants