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:
parent
05b39fe281
commit
c2545ddb6d
@ -3221,7 +3221,7 @@ const navigator = window.navigator;
|
||||
*/
|
||||
Player.prototype.options_ = {
|
||||
// Default order of fallback technology
|
||||
techOrder: ['html5'],
|
||||
techOrder: Tech.defaultTechs_,
|
||||
|
||||
html5: {},
|
||||
flash: {},
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user