videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
37.87k stars 7.43k forks source link

The player modal is closed by ESC key. #8645

Closed lalit-tudip closed 6 months ago

lalit-tudip commented 6 months ago

Description

I have created a modal on the top of the player using the player.createModal() method. The issue is upon using the ESC key from the keyboard the modal disappears and the blank player is displayed.

I'm using this modal to lock the player for parental control. So it should be removed only if a user pass the correct parental pin, but as I said it is easily removed by using the ESC button.

Reduced test case

NA

Steps to reproduce

NA

Errors

NA

What version of Video.js are you using?

7.21.4

Video.js plugins used.

"videojs-contrib-dash": "5.1.0", "videojs-contrib-eme": "3.9.0", "@videojs/http-streaming": "^2.8.0",

What browser(s) including version(s) does this occur with?

Each version of Chrome and Safari

What OS(es) and version(s) does this occur with?

All OS

gkatsev commented 6 months ago

you need to pass uncloseable:true as an option. see https://docs.videojs.com/player#createModal and https://docs.videojs.com/modaldialog#:~:text=as%20it%27s%20closed.-,uncloseable,-boolean

lalit-tudip commented 6 months ago

Thanks @gkatsev for the quick response, it worked. Now, I'm able to see the message on the player after pressing the ESC button.