The 12-second 'up next' countdown in my 1.17 MB player: auto-advance without the annoyance
i'm the dev behind RKMovies, a 1.17 MB Android media player with a Windows build. this is how the auto-next-episode thing works.
most players either jump to the next episode instantly or leave you to dig through menus. i wanted something in between: a small overlay on the video that counts down "up next S1E12 in 12s", with a button if you're impatient.
how it works:
-
progressTick()runs on everytimeupdate. at 92% of the episode it marks the ep watched and saves progress. every 15 seconds of playback it saves position too, so a crash never costs more than that. - when playback ends,
onEpisodeEnd()fires once (a flag guards the double-fire, since both ArtPlayer'svideo:endedand the raw video element emit it). if auto-next is off in settings, that's the end of it. - otherwise
showNextOverlay()paints the countdown inside the player host. a 1s ticker counts down from 12; at zero,autoNext()takes over. -
autoNext()picks the next ep in the current season, or rolls over to ep 1 of the next season, then callswatchEp(). movies (single season, se=0) never auto-advance, and if you've left the detail page it bails.
the edge cases that actually bit me: the overlay has to live inside the re-parented fullscreen node or it vanishes in fullscreen. a scrubbing guard skips progress ticks while you drag the seek bar. and if you seek back below the end after the countdown started, the timer cancels and the ep can re-arm it when it really ends.
try it out: this 1.17 MB player, the tiny Android build, and the Windows app for the TV setup.