1
0
mirror of https://github.com/videojs/video.js.git synced 2025-03-17 21:18:27 +02:00

feat: make registerTech add that tech to the default techOrder (#3985)

This commit is contained in:
Brandon Casey 2017-01-26 17:13:27 -05:00 committed by Gary Katsevman
parent 05b39fe281
commit c2545ddb6d
2 changed files with 12 additions and 1 deletions

View File

@ -3221,7 +3221,7 @@ const navigator = window.navigator;
*/
Player.prototype.options_ = {
// Default order of fallback technology
techOrder: ['html5'],
techOrder: Tech.defaultTechs_,
html5: {},
flash: {},

View File

@ -802,6 +802,10 @@ class Tech extends Component {
middleware.use('*', {name, tech});
Tech.techs_[name] = tech;
if (name !== 'Tech') {
// camel case the techName for use in techOrder
Tech.defaultTechs_.push(name.charAt(0).toLowerCase() + name.slice(1));
}
return tech;
}
@ -1171,4 +1175,11 @@ Tech.withSourceHandlers = function(_Tech) {
Component.registerComponent('Tech', Tech);
Tech.registerTech('Tech', Tech);
/**
* A list of techs that should be added to techOrder on Players
*
* @private
*/
Tech.defaultTechs_ = [];
export default Tech;