Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello
The goal of this pull-request is to allow application to implements their own ABRRules, or add some to existing rules.
There are 5 commits in this PR
1st is an export and a modification of FactoryMaker, so that external classes can create internal dashjs objects, such like SwitchRequest, using a factory. The idea is that FactoryMaker keeps an reference on objects factories. One object can then created externally.
Example using SwitchRequest :
//get switch request factory
var SwitchRequest = dashjs.FactoryMaker.getClassFactoryByName('SwitchRequest');
// create a switch request instance using factory :
var mySwitchRequest = SwitchRequest(context).create();
2nd commit adds methods to add custom rules to ABR collection. One custom rule is added to sample/dash-if-reference-player/app/rules/ directory. It has to be noticed, that the rule is using the FactoryMaker to be created by ABRCollection
3rd, 4th and 5th commits add the possibility to enable/disable internal ABR rules, and add another custom rule.
It has to be noticed that the given custom rules are only samples and do nothing. It's up to the service to implement their rules
I have reintroduced the possibility to ad a priority on SwitchRequests in rules. It may be useful for some customs rules (cf sample)
Jérémie COLLET