code: function onEvent(data) {
  	var type = data.type;
  
  	debug('onEvent() | [type:%s, data:%o]', type, data);
  
  	switch (type) {
  		case 'statechange':
  			this.readyState = data.readyState;
  			this._enabled = data.enabled;
  
  			switch (data.readyState) {
  				case 'initializing':
  					break;
  				case 'live':
  					break;
  				case 'ended':
  					this._ended = true;
  					this.dispatchEvent(new Event('ended'));
  					break;
  				case 'failed':
  					break;
  			}
  			break;
  	}
  }
docs: Private API.