Class ExoPlayerSourceSelector

java.lang.Object
com.brightcove.player.controller.ExoPlayerSourceSelector
All Implemented Interfaces:
SourceSelector

public final class ExoPlayerSourceSelector extends Object implements SourceSelector
The default Source Selector used with ExoPlayer. It attempts selecting a DeliveryType.DASH Source when available, or it will use BrightcoveSourceSelector.selectSource(Video) otherwise.

This selector prioritize HEVC sources for Android API level 21 and higher.

  • Constructor Details

    • ExoPlayerSourceSelector

      public ExoPlayerSourceSelector()
  • Method Details

    • selectSource

      @NonNull public Source selectSource(@NonNull Video video) throws NoSourceFoundException
      Determines best appropriate Source within given Video object based on logic implemented.
      Specified by:
      selectSource in interface SourceSelector
      Parameters:
      video - Video in which to find the most appropriate Source
      Returns:
      the best matched Source based on the currently implemented selection logic
      Throws:
      IllegalArgumentException - when the Video passed is null
      NoSourceFoundException - when no valid Source is found
    • canPlaySource

      public static boolean canPlaySource(Source source)
      Check if the device has a decoder for the given source. NOTE: The source must contain a codecs to determine if the device has a decoder.
      Parameters:
      source - The source to check.
      Returns:
      True if the device has an audio and video decoder based on the codecs.