1
0
mirror of https://github.com/videojs/video.js.git synced 2025-03-17 21:18:27 +02:00

fix: give techs a name (#3934)

This helps with debugging to know what a component's name is.
We try to look up the tech's name via the constructor's name property,
otherwise, we set it to 'Unknown Tech'. Can be overridden by setting
`this.name_` after calling `super()` in the constructor.

Fixes #1786.
This commit is contained in:
Gary Katsevman 2017-01-11 16:26:24 -05:00 committed by GitHub
parent 2ceed0a4eb
commit 94fd5c12c8

View File

@ -145,6 +145,10 @@ class Tech extends Component {
if (!options.nativeControlsForTouch) {
this.emitTapEvents();
}
if (this.constructor) {
this.name_ = this.constructor.name || 'Unknown Tech';
}
}
/* Fallbacks for unsupported event types