Improving the Player on Android
Article Summary
Pinterest's Android team faced a unique challenge: playing multiple videos simultaneously in a two-column grid without killing performance. Here's how they optimized ExoPlayer to handle it.
The Pinterest Engineering team shares their deep dive into video player optimization for Android. They tackled startup latency, memory management, and bandwidth issues specific to their mixed-media feed experience.
Key Takeaways
- Warm up network connections with dummy HTTP HEAD requests before videos load
- Cut buffer durations to 500ms for short-form content (down from defaults)
- Disable audio rendering entirely for muted in-feed videos to save bandwidth
- Pool player instances by encoding type to avoid decoder switching overhead
- Purge corrupted cache on fatal IO errors to prevent persistent playback failures
Critical Insight
By customizing ExoPlayer's DefaultLoadControl, DefaultTrackSelector, and building a smart player pool, Pinterest significantly reduced video startup latency while managing memory constraints.