Network switch ‐ Seamless bitrate adaptation during poor connectivity. - devrath/MediaAlchemySuite GitHub Wiki
About
- Sometimes there is a
network drop(speed of data retrieval varies)
, which can also happen when you switch the source of data from wifi to mobile data.
How is it handled
It is automatically handled by the exo-player
How It Works Under the Hood
⚙️- The exoplayer uses
DefaultTrackSelector
to choose a track with the help ofBandwidthMeter
and usesAdaptiveTrackSelection
to set the new track. - Whenever your network slows down, your bandwidth meter finds the reduced bandwidth and a lower
bitrate/resolution
is selected by player.
Representation
┌────────────────────────────┐
│ Network Switch Event │
│ (e.g., WiFi → Mobile Data) │
└────────────┬───────────────┘
│
▼
┌────────────────────────────────────┐
│ Bandwidth drops (measured live) │
│ via DefaultBandwidthMeter │
└────────────┬───────────────────────┘
│
▼
┌───────────────────────────────────────────────┐
│ TrackSelector picks a lower-bitrate stream │
│ using AdaptiveTrackSelection logic │
└────────────┬──────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────┐
│ Player fetches next segment at new quality │
│ (e.g., 720p → 480p) │
└────────────┬──────────────────────────────────┘
│
▼
┌──────────────────────────────┐
│ Playback continues smoothly │
│ with no interruption │
└──────────────────────────────┘