-
- All Implemented Interfaces:
-
com.brightcove.player.controller.SourceSelector
,com.brightcove.player.event.Component
@ListensFor(events = {EventType.SELECT_SOURCE})@Emits(events = {EventType.SOURCE_NOT_FOUND}) public class DefaultSourceSelectionController extends AbstractComponent implements Component, SourceSelector
Default SourceSelector controller responsible to react to the SELECT_SOURCE event and call selectSource of the SourceSelector set. By default, BrightcoveSourceSelector is used.
The selected Source will be added to the SELECT_SOURCE event properties with the SOURCE key.
-
-
Field Summary
Fields Modifier and Type Field Description public final static String
TAG
private SourceSelector
sourceSelector
-
Constructor Summary
Constructors Constructor Description DefaultSourceSelectionController(EventEmitter eventEmitter)
Initializes this controller with the given EventEmitter using the default BrightcoveSourceSelector.
-
Method Summary
Modifier and Type Method Description SourceSelector
getSourceSelector()
void
setSourceSelector(@NonNull() SourceSelector sourceSelector)
static DefaultSourceSelectionController
create(@NonNull() EventEmitter eventEmitter)
Creates the Default Source Selection Controller using the default BrightcoveSourceSelector. static DefaultSourceSelectionController
createWithSourceSelector(@NonNull() EventEmitter eventEmitter, @NonNull() SourceSelector sourceSelector)
Creates the Default Source Selection Controller with a custom SourceSelector. Source
selectSource(@NonNull() Video video)
Source
findBestSourceByBitRate(SourceCollection sourceCollection, Integer bitRate)
Given a SourceCollection, finds the Source with the closest bit rate to the given value. -
-
Constructor Detail
-
DefaultSourceSelectionController
DefaultSourceSelectionController(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
-
getSourceSelector
@NonNull() SourceSelector getSourceSelector()
-
setSourceSelector
void setSourceSelector(@NonNull() SourceSelector sourceSelector)
-
create
static DefaultSourceSelectionController create(@NonNull() EventEmitter eventEmitter)
Creates the Default Source Selection Controller using the default BrightcoveSourceSelector.
- Parameters:
eventEmitter
- the event emitter
-
createWithSourceSelector
static DefaultSourceSelectionController createWithSourceSelector(@NonNull() EventEmitter eventEmitter, @NonNull() SourceSelector sourceSelector)
Creates the Default Source Selection Controller with a custom SourceSelector.
- Parameters:
eventEmitter
- the event emittersourceSelector
- the source selector
-
selectSource
@NonNull() Source selectSource(@NonNull() Video video)
-
findBestSourceByBitRate
Source findBestSourceByBitRate(SourceCollection sourceCollection, 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 foundbitRate
- the target bit rate desired for the chosen Source
-
-
-
-