extend.js
Methods
inner extend(superClass, subClassMethodsopt) → {function}
[extend.js](https://docs.videojs.com/extend.js.html)
, [line 29](https://docs.videojs.com/extend.js.html#line29)
Used to subclass an existing class by emulating ES subclassing using the extends
keyword.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
superClass | function | The class to inherit from | ||
subClassMethods | Object | <optional> | {} | Methods of the new class |
Returns:
function -
The new class with subClassMethods that inherited superClass.
Example
var MyComponent = videojs.extend(videojs.getComponent('Component'), {
myCustomMethod: function() {
// Do things in my method.
}
});