1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-25 02:42:10 +02:00

@gkatsev updated MediaLoader to check for techs in their registry. closes #2798

This commit is contained in:
Gary Katsevman 2015-11-10 15:53:14 -05:00
parent 210caea7f0
commit d1316a39ab
3 changed files with 10 additions and 4 deletions

View File

@ -15,6 +15,7 @@ CHANGELOG
* @zjruan updated text track prototype loops to blacklist constructor for IE8 ([view](https://github.com/videojs/video.js/pull/2565))
* @gkatsev fixed usage of textTracksToJson ([view](https://github.com/videojs/video.js/pull/2797))
* @gkatsev updated contrib.json to use / as branch-name separator in feature-accept ([view](https://github.com/videojs/video.js/pull/2803))
* @gkatsev updated MediaLoader to check for techs in their registry ([view](https://github.com/videojs/video.js/pull/2798))
--------------------

View File

@ -1,7 +1,8 @@
/**
* @file loader.js
*/
import Component from '../component';
import Component from '../component.js';
import Tech from './tech.js';
import window from 'global/window';
import toTitleCase from '../utils/to-title-case.js';
@ -26,7 +27,12 @@ class MediaLoader extends Component {
if (!options.playerOptions['sources'] || options.playerOptions['sources'].length === 0) {
for (let i=0, j=options.playerOptions['techOrder']; i<j.length; i++) {
let techName = toTitleCase(j[i]);
let tech = Component.getComponent(techName);
let tech = Tech.getTech(techName);
// Support old behavior of techs being registered as components.
// Remove once that deprecated behavior is removed.
if (!techName) {
tech = Component.getComponent(techName);
}
// Check if the browser supports this technology
if (tech && tech.isSupported()) {

View File

@ -2,7 +2,6 @@
// can run without HTML5 or Flash, of which PhantomJS supports neither.
import Tech from '../../../src/js/tech/tech.js';
import Component from '../../../src/js/component.js';
/**
* @constructor
@ -54,5 +53,5 @@ class TechFaker extends Tech {
static canPlaySource(srcObj) { return srcObj.type !== 'video/unsupported-format'; }
}
Component.registerComponent('TechFaker', TechFaker);
Tech.registerTech('TechFaker', TechFaker);
export default TechFaker;