Skip to content

Commit f1558c6

Browse files
authored
fix(videojs): missing return in registerComponent (#8247)
1 parent 866ef24 commit f1558c6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/js/video.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ videojs.registerComponent = (name, comp) => {
323323
log.warn(`The ${name} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`);
324324
}
325325

326-
Component.registerComponent.call(Component, name, comp);
326+
return Component.registerComponent.call(Component, name, comp);
327327
};
328328

329329
videojs.getTech = Tech.getTech;

test/unit/player.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,6 +2165,12 @@ QUnit.test('When VIDEOJS_NO_DYNAMIC_STYLE is set, apply sizing directly to the t
21652165
window.VIDEOJS_NO_DYNAMIC_STYLE = originalVjsNoDynamicStyling;
21662166
});
21672167

2168+
QUnit.test('should return the registered component', function(assert) {
2169+
class CustomPlayer extends Player {}
2170+
2171+
assert.strictEqual(videojs.registerComponent('CustomPlayer', CustomPlayer), CustomPlayer, 'the component is returned');
2172+
});
2173+
21682174
QUnit.test('should allow to register custom player when any player has not been created', function(assert) {
21692175
class CustomPlayer extends Player {}
21702176
videojs.registerComponent('Player', CustomPlayer);

0 commit comments

Comments
 (0)