perf: playlist playback + media cache; serialization alignment#2
Merged
Conversation
Improve perceived load time without breaking the singleton-player rule (still exactly one ExoPlayer): - Load the whole feed as a single playlist (setMediaItems) and switch reels with seekToDefaultPosition(index), so ExoPlayer pre-buffers neighbouring items and swipes start faster. ReelPlayerController exposes setReels()/playAt() instead of bind(). - Add a 256 MB LRU media cache (SimpleCache + CacheDataSource) so re-watched reels start instantly. - Bump kotlinx-serialization to 1.8.0 to match the Kotlin 2.1 plugin (clears the InternalSerializationApi warning); add a file-level opt-in on NetworkReel for IDEs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduces perceived load time on the reels feed without breaking the singleton-player requirement (still exactly one
ExoPlayer).Changes
setMediaItems) and switch reels viaseekToDefaultPosition(index). ExoPlayer pre-buffers neighbouring items, so swiping to the next reel starts much faster.ReelPlayerControllernow exposessetReels()/playAt()instead ofbind().SimpleCache+CacheDataSourceso already-watched reels start instantly on re-watch.kotlinx-serializationto 1.8.0 (matches the Kotlin 2.1 plugin, clears theInternalSerializationApiwarning) and add a file-level opt-in onNetworkReelso IDE analyzers stay quiet.Testing
./gradlew lintDebug testDebugUnitTest assembleDebuggreenNotes
The singleton remains one
ExoPlayer; only the playlist/seek strategy changed. Frame-thumbnail extraction was explored separately and intentionally not included (off-screen GPU readback was unreliable); thumbnails stay required.🤖 Generated with Claude Code