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:
NameTypeAttributesDefaultDescription
superClassfunction

The class to inherit from

subClassMethodsObject<optional>
{}

Methods of the new class

Returns:

function -

The new class with subClassMethods that inherited superClass.

Example
  1. var MyComponent = videojs.extend(videojs.getComponent('Component'), {
  2. myCustomMethod: function() {
  3. // Do things in my method.
  4. }
  5. });