function evented(target) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var eventBusKey = options.eventBusKey;

  // Set or create the eventBusEl_.

  if (eventBusKey) {
    if (!target[eventBusKey].nodeName) {
      throw new Error('The eventBusKey "' + eventBusKey + '" does not refer to an element.');
    }
    target.eventBusEl_ = target[eventBusKey];
  } else {
    target.eventBusEl_ = createEl('span', { className: 'vjs-event-bus' });
  }

  assign(target, EventedMixin);

  // When any evented object is disposed, it removes all its listeners.
  target.on('dispose', function () {
    return target.off();
  });

  return target;
}
function evented(target) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var eventBusKey = options.eventBusKey;

  

  if (eventBusKey) {
    if (!target[eventBusKey].nodeName) {
      throw new Error('The eventBusKey "' + eventBusKey + '" does not refer to an element.');
    }
    target.eventBusEl_ = target[eventBusKey];
  } else {
    target.eventBusEl_ = createEl('span', { className: 'vjs-event-bus' });
  }

  assign(target, EventedMixin);

  
  target.on('dispose', function () {
    return target.off();
  });

  return target;
}
function evented ( target ) { var options = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ; var eventBusKey = options . eventBusKey ; // Set or create the eventBusEl_. if ( eventBusKey ) { if ( ! target [ eventBusKey ] . nodeName ) { throw new Error ( 'The eventBusKey "' + eventBusKey + '" does not refer to an element.' ) ; } target . eventBusEl_ = target [ eventBusKey ] ; } else { target . eventBusEl_ = createEl ( 'span' , { className : 'vjs-event-bus' } ) ; } assign ( target , EventedMixin ) ; // When any evented object is disposed, it removes all its listeners. target . on ( 'dispose' , function ( ) { return target . off ( ) ; } ) ; return target ; }
Applies {@link module:evented~EventedMixin|EventedMixin} to a target object.

@param  {Object} target
The object to which to add event methods.

@param  {Object} [options={}]
Options for customizing the mixin behavior.

@param  {String} [options.eventBusKey]
By default, adds a `eventBusEl_` DOM element to the target object,
which is used as an event bus. If the target object already has a
DOM element that should be used, pass its key here.

@return {Object}
The target object.
Applies { @link module : evented~EventedMixin|EventedMixin } to a target object .