Class DefaultSourceSelectionController

    • Field Detail

      • TAG

        public static final java.lang.String TAG
    • Constructor Detail

      • DefaultSourceSelectionController

        public DefaultSourceSelectionController​(@NonNull
                                                EventEmitter eventEmitter)
        Initializes this controller with the given EventEmitter using the default BrightcoveSourceSelector.
        Parameters:
        eventEmitter - the EventEmitter through which this controller will interact
    • Method Detail

      • createWithSourceSelector

        public static DefaultSourceSelectionController createWithSourceSelector​(@NonNull
                                                                                EventEmitter eventEmitter,
                                                                                @NonNull
                                                                                SourceSelector sourceSelector)
        Creates the Default Source Selection Controller with a custom SourceSelector.
        Parameters:
        eventEmitter - the event emitter
        sourceSelector - the source selector
        Returns:
        the default source selection controller
      • setSourceSelector

        public void setSourceSelector​(@NonNull
                                      SourceSelector sourceSelector)
      • getSourceSelector

        @NonNull
        public SourceSelector getSourceSelector()
      • selectSource

        @Nullable
        protected Source selectSource​(@Nullable
                                      java.util.Set<Source> sources)
        Attempts to select the HTTPS source included in the source Set, if available. Otherwise, it will select the first source given by the Set Iterator.

        It will return null if the sources Set is null or empty.

        Parameters:
        sources - the source Set.
        Returns:
        the selected source
      • findBestSourceByBitRate

        public Source findBestSourceByBitRate​(SourceCollection sourceCollection,
                                              java.lang.Integer bitRate)
        Given a SourceCollection, finds the Source with the closest bit rate to the given value.
        Parameters:
        sourceCollection - the collection of Sources in which the match should be found
        bitRate - the target bit rate desired for the chosen Source
        Returns:
        the Source that most closely matches the given bit rate, or any Source, if no match can be found
      • initializeListeners

        protected void initializeListeners()