mirror of
https://github.com/videojs/video.js.git
synced 2024-12-25 02:42:10 +02:00
@dconnolly exported the missing videojs.plugin function. closes #2103
This commit is contained in:
parent
cc6c3daaed
commit
f84632e057
@ -21,6 +21,7 @@ CHANGELOG
|
||||
* @bc-bbay Load plugins before controls ([view](https://github.com/videojs/video.js/pull/2094))
|
||||
* @bc-bbay rename onEvent methods to handleEvent ([view](https://github.com/videojs/video.js/pull/2093))
|
||||
* @dmlap added an error message if techOrder is not in options ([view](https://github.com/videojs/video.js/pull/2097))
|
||||
* @dconnolly exported the missing videojs.plugin function ([view](https://github.com/videojs/video.js/pull/2103))
|
||||
|
||||
--------------------
|
||||
|
||||
|
@ -17,6 +17,7 @@ import * as Lib from './lib';
|
||||
import * as Util from './util.js';
|
||||
import Player from './player';
|
||||
import extendsFn from './extends.js';
|
||||
import plugin from './plugins.js';
|
||||
|
||||
if (typeof HTMLVideoElement === 'undefined') {
|
||||
document.createElement('video');
|
||||
@ -41,6 +42,8 @@ videojs.players = Player.players;
|
||||
|
||||
videojs.extends = extendsFn;
|
||||
|
||||
videojs.plugin = plugin;
|
||||
|
||||
// REMOVING: We probably should not include this in 5.0 thought it would make it
|
||||
// more backwards compatible
|
||||
// // Expose but deprecate the window[componentName] method for accessing components
|
||||
|
23
test/unit/video.js
Normal file
23
test/unit/video.js
Normal file
@ -0,0 +1,23 @@
|
||||
import videojs from '../../src/js/video.js';
|
||||
import TestHelpers from './test-helpers.js';
|
||||
|
||||
q.module('video.js');
|
||||
|
||||
test('should expose plugin registry function', function() {
|
||||
var pluginName, pluginFunction, player;
|
||||
|
||||
pluginName = 'foo';
|
||||
pluginFunction = function(options) {
|
||||
console.log(this);
|
||||
};
|
||||
|
||||
ok(videojs.plugin, 'should exist');
|
||||
|
||||
videojs.plugin(pluginName, pluginFunction);
|
||||
|
||||
player = TestHelpers.makePlayer();
|
||||
|
||||
ok(player.foo, 'should exist');
|
||||
equal(player.foo, pluginFunction, 'should be equal');
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user