¿Puedo deshabilitar algunos atajos de teclado del video de Vimeo incrustado en lugar de deshabilitar todos los atajos?
A menudo inserto el video de Vimeo a través de iframe en mi sitio web para videoconferencias. Necesito ocultar la barra de control y deshabilitar todos los atajos excepto el atajo "F"
¿Hay una manera de lograr esto?
Gracias
Pruebe el código guardándolo localmente en su dispositivo o utilizando un compilador de código de terceros, ya que Stack Overflow no permite "pantalla completa", y asegúrese de que el iframe esté activo o enfocado.
var options = { id: 59777392, //Video Id width: 640, keyboard: false, }; var player = new Vimeo.Player('VimeoVideo', options); player.on('play', function() { window.focus() }); player.on('pause', function() { window.focus() }); window.addEventListener("blur", () => { { if (document.activeElement.tagName === "IFRAME") { check(); //Checks if Iframe is already in Full Screen } }; }); function check(){ if(window.innerHeight !== screen.height) { //If the Iframe is not full screen then make it full screen when user presses 'F', this will work only after the Vimeo Video Iframe has completed loading. document.addEventListener("keydown", event => { if (event.isComposing || event.keyCode !== 70) { return; } player.requestFullscreen(); })} else{ document.addEventListener("keydown", event => {//If the Iframe is in full screen then make it normal, this function might not be executed if user do not interacts. if (event.isComposing || event.keyCode !== 70) { return; } player.exitFullscreen(); }) } } <!-- The Keyboard is disbaled and only 'F' key is enabled --> <div id="VimeoVideo"></div> <script src="https://player.vimeo.com/api/player.js"></script>