media3/library/smoothstreaming
krocard ec43735054 Split mutations method out of TrackSelection
`TrackSelection` had mutation methods which were to be called only
internally by ExoPlayer components but were exposed in the
public `Player` interface.

The mutation methods have been moved out of `TrackSelection`
to a new class `ExoTrackSelection`.

Current track related read-only method have also been moved out,
because they are actually something quite unclear.
Even for a single item playlist, it's the track being buffered rather
than the track being played, which is unclear.
But when you have a playlist it starts to get really confusing,
because if the next item is being buffered, then it's actually
the last track to be buffered in the currently playing item.
As a final aside, the implementations don't do proper thread synchronization
to ensure visibility of updated state by the calling thread.

Exposing those mutable methods in the public `Player` interface
was problematic because they leaking internal concepts of `ExoPlayer`.
This is also required to minimize the `Player` interface for long term
stability.

`ExoTrackSelection` is a subclass of `TrackSelection`.
This is not ideal as an `TrackSelection` implementation could
break the current immutability.
This was done in order for this refactor to be simpler.
A future patch will fully split the two classes.

All `MediaPeriod` and `Sources` had to be updated to use the new
`TrackSelection` dynamic aspect class name.
An alternative would have been to break ExoPlayer's public API, keeping
`TrackSelection` as the dynamic aspect name, and calling the public static
aspect class `TrackSelectionState` or similar.
Nevertheless, while it would have impacted less files, it would have
many more small apps and casual users of ExoPlayer.

#player-to-common

PiperOrigin-RevId: 353637924
2021-01-25 15:37:38 +00:00
..
2020-09-07 20:42:23 +01:00

ExoPlayer SmoothStreaming library module

Provides support for SmoothStreaming content.

Adding a dependency to this module is all that's required to enable playback of SmoothStreaming MediaItems added to an ExoPlayer or SimpleExoPlayer in their default configurations. Internally, DefaultMediaSourceFactory will automatically detect the presence of the module and convert SmoothStreaming MediaItems into SsMediaSource instances for playback.

Similarly, a DownloadManager in its default configuration will use DefaultDownloaderFactory, which will automatically detect the presence of the module and build SsDownloader instances to download SmoothStreaming content.

For advanced playback use cases, applications can build SsMediaSource instances and pass them directly to the player. For advanced download use cases, SsDownloader can be used directly.

  • Developer Guide.
  • Javadoc: Classes matching com.google.android.exoplayer2.source.smoothstreaming.* belong to this module.