@ListensFor(events="selectSource") @Emits(events="sourceNotFound") public class DefaultSourceSelectionController extends AbstractComponent implements Component, SourceSelector
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TAG |
eventEmitter, listenerTokens
Constructor and Description |
---|
DefaultSourceSelectionController(EventEmitter eventEmitter)
Initializes this controller with the given EventEmitter.
|
Modifier and Type | Method and Description |
---|---|
Source |
findBestSourceByBitRate(SourceCollection sourceCollection,
java.lang.Integer bitRate)
Given a SourceCollection, finds the Source with the closest bit rate to the given value.
|
protected void |
initializeListeners() |
Source |
selectSource(Video video)
Determines best appropriate Source within given Video object based on logic implemented.
|
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
public DefaultSourceSelectionController(EventEmitter eventEmitter)
eventEmitter
- the EventEmitter through which this controller will interactpublic Source selectSource(Video video) throws NoSourceFoundException
SourceSelector
selectSource
in interface SourceSelector
video
- Video in which to find the most appropriate SourceNoSourceFoundException
SourceSelector.selectSource(com.brightcove.player.model.Video)
public Source findBestSourceByBitRate(SourceCollection sourceCollection, java.lang.Integer bitRate) throws NoSourceFoundException
sourceCollection
- the collection of Sources in which the match should be foundbitRate
- the target bit rate desired for the chosen SourceNoSourceFoundException
protected void initializeListeners()