File tree 10 files changed +29
-11
lines changed
10 files changed +29
-11
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class BigPlayButton extends Button {
36
36
* This gets called when a `BigPlayButton` "clicked". See {@link ClickableComponent}
37
37
* for more detailed information on what a click can be.
38
38
*
39
- * @param {KeyboardEvent } event
39
+ * @param {KeyboardEvent|MouseEvent|TouchEvent } event
40
40
* The `keydown`, `tap`, or `click` event that caused this function to be
41
41
* called.
42
42
*
@@ -47,7 +47,7 @@ class BigPlayButton extends Button {
47
47
const playPromise = this . player_ . play ( ) ;
48
48
49
49
// exit early if clicked via the mouse
50
- if ( this . mouseused_ && event . clientX && event . clientY ) {
50
+ if ( this . mouseused_ && ' clientX' in event && ' clientY' in event ) {
51
51
silencePromise ( playPromise ) ;
52
52
53
53
if ( this . player_ . tech ( true ) ) {
@@ -74,12 +74,29 @@ class BigPlayButton extends Button {
74
74
}
75
75
}
76
76
77
+ /**
78
+ * Event handler that is called when a `BigPlayButton` receives a
79
+ * `keydown` event.
80
+ *
81
+ * @param {KeyboardEvent } event
82
+ * The `keydown` event that caused this function to be called.
83
+ *
84
+ * @listens keydown
85
+ */
77
86
handleKeyDown ( event ) {
78
87
this . mouseused_ = false ;
79
88
80
89
super . handleKeyDown ( event ) ;
81
90
}
82
91
92
+ /**
93
+ * Handle `mousedown` events on the `BigPlayButton`.
94
+ *
95
+ * @param {MouseEvent } event
96
+ * `mousedown` or `touchstart` event that triggered this function
97
+ *
98
+ * @listens mousedown
99
+ */
83
100
handleMouseDown ( event ) {
84
101
this . mouseused_ = true ;
85
102
}
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ class Button extends ClickableComponent {
106
106
* This gets called when a `Button` has focus and `keydown` is triggered via a key
107
107
* press.
108
108
*
109
- * @param {Event } event
109
+ * @param {KeyboardEvent } event
110
110
* The event that caused this function to get called.
111
111
*
112
112
* @listens keydown
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ class ClickableComponent extends Component {
233
233
*
234
234
* By default, if the key is Space or Enter, it will trigger a `click` event.
235
235
*
236
- * @param {Event } event
236
+ * @param {KeyboardEvent } event
237
237
* The `keydown` event that caused this function to be called.
238
238
*
239
239
* @listens keydown
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ class CloseButton extends Button {
71
71
*
72
72
* By default, if the key is Esc, it will trigger a `click` event.
73
73
*
74
- * @param {Event } event
74
+ * @param {KeyboardEvent } event
75
75
* The `keydown` event that caused this function to be called.
76
76
*
77
77
* @listens keydown
Original file line number Diff line number Diff line change @@ -1324,7 +1324,7 @@ class Component {
1324
1324
* delegates to `handleKeyDown`. This means anyone calling `handleKeyPress`
1325
1325
* will not see their method calls stop working.
1326
1326
*
1327
- * @param {Event } event
1327
+ * @param {KeyboardEvent } event
1328
1328
* The event that caused this function to be called.
1329
1329
*/
1330
1330
handleKeyPress ( event ) {
@@ -1336,7 +1336,7 @@ class Component {
1336
1336
* support toggling the controls through a tap on the video. They get enabled
1337
1337
* because every sub-component would have extra overhead otherwise.
1338
1338
*
1339
- * @private
1339
+ * @protected
1340
1340
* @fires Component#tap
1341
1341
* @listens Component#touchstart
1342
1342
* @listens Component#touchmove
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ class MenuItem extends ClickableComponent {
88
88
* Ignore keys which are used by the menu, but pass any other ones up. See
89
89
* {@link ClickableComponent#handleKeyDown} for instances where this is called.
90
90
*
91
- * @param {Event } event
91
+ * @param {KeyboardEvent } event
92
92
* The `keydown` event that caused this function to be called.
93
93
*
94
94
* @listens keydown
Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ class Menu extends Component {
205
205
/**
206
206
* Handle a `keydown` event on this menu. This listener is added in the constructor.
207
207
*
208
- * @param {Event } event
208
+ * @param {KeyboardEvent } event
209
209
* A `keydown` event that happened on the menu.
210
210
*
211
211
* @listens keydown
Original file line number Diff line number Diff line change @@ -3164,7 +3164,7 @@ class Player extends Component {
3164
3164
* This allows player-wide hotkeys (either as defined below, or optionally
3165
3165
* by an external function).
3166
3166
*
3167
- * @param {Event } event
3167
+ * @param {KeyboardEvent } event
3168
3168
* The `keydown` event that caused this function to be called.
3169
3169
*
3170
3170
* @listens keydown
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ function _cleanUpEvents(elem, type) {
64
64
* @param {Element|Object } elem
65
65
* Element or object to bind listeners to
66
66
*
67
- * @param {string } type
67
+ * @param {string[] } types
68
68
* Type of event to bind to.
69
69
*
70
70
* @param {Function } callback
Original file line number Diff line number Diff line change 2
2
"include" : [" src/js/**/*" ],
3
3
"compilerOptions" : {
4
4
"allowJs" : true ,
5
+ "allowSyntheticDefaultImports" : true ,
5
6
"declaration" : true ,
6
7
"emitDeclarationOnly" : true ,
7
8
"outDir" : " dist/types" ,
You can’t perform that action at this time.
0 commit comments