Class MergingMediaSource

  • All Implemented Interfaces:
    MediaSource

    @Deprecated
    public final class MergingMediaSource
    extends CompositeMediaSource<Integer>
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    Merges multiple MediaSources.

    The Timelines of the sources being merged must have the same number of periods.

    • Constructor Detail

      • MergingMediaSource

        public MergingMediaSource​(MediaSource... mediaSources)
        Deprecated.
        Creates a merging media source.

        Neither offsets between the timestamps in the media sources nor the durations of the media sources will be adjusted.

        Parameters:
        mediaSources - The MediaSources to merge.
      • MergingMediaSource

        public MergingMediaSource​(boolean adjustPeriodTimeOffsets,
                                  MediaSource... mediaSources)
        Deprecated.
        Creates a merging media source.

        Durations of the media sources will not be adjusted.

        Parameters:
        adjustPeriodTimeOffsets - Whether to adjust timestamps of the merged media sources to all start at the same time.
        mediaSources - The MediaSources to merge.
      • MergingMediaSource

        public MergingMediaSource​(boolean adjustPeriodTimeOffsets,
                                  boolean clipDurations,
                                  MediaSource... mediaSources)
        Deprecated.
        Creates a merging media source.
        Parameters:
        adjustPeriodTimeOffsets - Whether to adjust timestamps of the merged media sources to all start at the same time.
        clipDurations - Whether to clip the durations of the media sources to match the shortest duration.
        mediaSources - The MediaSources to merge.
      • MergingMediaSource

        public MergingMediaSource​(boolean adjustPeriodTimeOffsets,
                                  boolean clipDurations,
                                  CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory,
                                  MediaSource... mediaSources)
        Deprecated.
        Creates a merging media source.
        Parameters:
        adjustPeriodTimeOffsets - Whether to adjust timestamps of the merged media sources to all start at the same time.
        clipDurations - Whether to clip the durations of the media sources to match the shortest duration.
        compositeSequenceableLoaderFactory - A factory to create composite SequenceableLoaders for when this media source loads data from multiple streams (video, audio etc...).
        mediaSources - The MediaSources to merge.