@@ -134,7 +134,6 @@ class Vlitejs {
134
134
135
135
this . onClickOnPlayer = this . onClickOnPlayer . bind ( this )
136
136
this . onDoubleClickOnPlayer = this . onDoubleClickOnPlayer . bind ( this )
137
- this . onKeydown = this . onKeydown . bind ( this )
138
137
this . onMousemove = this . onMousemove . bind ( this )
139
138
this . onChangeFullScreen = this . onChangeFullScreen . bind ( this )
140
139
@@ -245,57 +244,6 @@ class Vlitejs {
245
244
}
246
245
}
247
246
248
- /**
249
- * On keydown event on the media element
250
- * @param e Event listener datas
251
- */
252
- onKeydown ( e : KeyboardEvent ) {
253
- const activeElement = document . activeElement
254
- const { keyCode } = e
255
-
256
- // Stop and start the auto hide timer on selected key code
257
- if (
258
- [ 9 , 32 , 37 , 39 ] . includes ( keyCode ) &&
259
- this . autoHideGranted &&
260
- ( activeElement === this . container || activeElement ?. closest ( '.v-vlite' ) )
261
- ) {
262
- this . stopAutoHideTimer ( )
263
- this . startAutoHideTimer ( )
264
- }
265
-
266
- // Backward or forward video with arrow keys
267
- if (
268
- [ 37 , 39 ] . includes ( keyCode ) &&
269
- ( activeElement === this . container || activeElement === this . player . elements . progressBar )
270
- ) {
271
- // Prevent default behavior on input range
272
- e . preventDefault ( )
273
-
274
- if ( keyCode === 37 ) {
275
- this . fastForward ( 'backward' )
276
- } else if ( keyCode === 39 ) {
277
- this . fastForward ( 'forward' )
278
- }
279
- }
280
-
281
- // Increase or decrease volume with arrow keys
282
- if (
283
- [ 38 , 40 ] . includes ( keyCode ) &&
284
- ( activeElement === this . container || activeElement === this . player . elements . volume )
285
- ) {
286
- if ( keyCode === 38 ) {
287
- this . increaseVolume ( )
288
- } else if ( keyCode === 40 ) {
289
- this . decreaseVolume ( )
290
- }
291
- }
292
-
293
- // Toggle the media playback with spacebar key
294
- if ( keyCode === 32 && activeElement === this . container ) {
295
- this . player . controlBar . togglePlayPause ( e )
296
- }
297
- }
298
-
299
247
/**
300
248
* On mousemove on the player
301
249
*/
@@ -316,37 +264,6 @@ class Vlitejs {
316
264
}
317
265
}
318
266
319
- /**
320
- * Trigger the video fast forward (front and rear)
321
- * @param direction Direction (backward|forward)
322
- */
323
- fastForward ( direction : string ) {
324
- this . player . getCurrentTime ( ) . then ( ( seconds : number ) => {
325
- this . player . seekTo (
326
- direction === 'backward' ? seconds - this . options . seekTime : seconds + this . options . seekTime
327
- )
328
- } )
329
- }
330
-
331
- /**
332
- * Increase the player volume
333
- */
334
- increaseVolume ( ) {
335
- this . player . isMuted && this . player . unMute ( )
336
- this . player . getVolume ( ) . then ( ( volume : number ) => {
337
- this . player . setVolume ( Math . min ( Math . round ( ( volume + this . options . volumeStep ) * 10 ) / 10 , 1 ) )
338
- } )
339
- }
340
-
341
- /**
342
- * Decrease the player volume
343
- */
344
- decreaseVolume ( ) {
345
- this . player . getVolume ( ) . then ( ( volume : number ) => {
346
- this . player . setVolume ( Math . max ( Math . round ( ( volume - this . options . volumeStep ) * 10 ) / 10 , 0 ) )
347
- } )
348
- }
349
-
350
267
/**
351
268
* Stop the auto hide timer and show the video control bar
352
269
*/
0 commit comments